Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrimUrls is removing necessary information for JSON-LD #66

Closed
ahmadalfy opened this issue Jan 14, 2018 · 1 comment
Closed

TrimUrls is removing necessary information for JSON-LD #66

ahmadalfy opened this issue Jan 14, 2018 · 1 comment

Comments

@ahmadalfy
Copy link

ahmadalfy commented Jan 14, 2018

This class remove the URL scheme from everywhere.

\RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class,

This renders the JSON-LD object invalid and stop Google from properly indexing your rich snippets.

<script type="application/ld+json">
{  
   "@context":"http://schema.org",
   "thumbnailUrl":"http://sampleurl"
}
</script>

Become this:

<script type="application/ld+json">
{  
   "@context":"//schema.org",
   "thumbnailUrl":"//sampleurl"
}
</script>

It should automatically exclude these parts

@joaorobertopb
Copy link
Collaborator

Hi!

Trimming URLs is considered medium risk. It can cause problems if it uses the wrong base URL.
References ( #61 #60 #53 ).

In your case, do not register: \RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class

Soon we will be updating the documentation of the package, leaving more explicit the risks that each filter can cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants