Unrecognized script:'<script type="application/ld+json"></script>

35 views
Skip to first unread message

Richard

unread,
Jan 18, 2020, 6:04:39 PM1/18/20
to ngx-pagespeed-discuss
Hi, 

Got ngx_pagespeed working great on my WordPress site. But one nagging error keeps popping in PageSpeed messages log and it's Unrecognized script:'<script type="application/ld+json"></script>

I searched in entire Internet and can't find anything that could help me. 

If it's possible, is there a disallow feature that maybe I can turn on to skip this ld+json file?

Thanks,
Richard

Longinos

unread,
Jan 19, 2020, 9:03:11 AM1/19/20
to ngx-pagespeed-discuss
Hi
These are not a external file but an inlined script.
Pagespeed recognizes <script  tag and try to optimize but the type of script (application+json) is not betwen the types pagespeed may optimize so throw the message.
Nothing is broken, only the warning message.
The only way I know is disabling all the javascript filters (Do you want that?) and the pagespeed don´t try to optimize any <script...

Joshua Marantz

unread,
Jan 19, 2020, 9:14:13 AM1/19/20
to ngx-pagesp...@googlegroups.com
Rewriting of inlined and external scripts is separately controlled, so you can do:

pagespeed EnableFilters rewrite_javascript_external;
pagespeed DisableFilters rewrite_javascript_internal;

See https://www.modpagespeed.com/doc/filter-js-minify for details.

Also is it possible to clean up your markup to remove that script tag? Does it have some benefit to some other system in your web stack?



--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ngx-pagespeed-discuss/9b6cf21b-43e0-4060-b7d7-a077eecc34bf%40googlegroups.com.

Richard

unread,
Jan 26, 2020, 12:32:20 PM1/26/20
to ngx-pagespeed-discuss
Ok, found the issues.

It has to do with a SEO plugin I installed to provide schema markup for my site. Apparently ngx_pagespeed can't understand the script definitions.
Below is an example of the script that get loaded in the page header file.

<script type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":


Thanks,
Richard

On Sunday, January 19, 2020 at 8:14:13 AM UTC-6, Joshua Marantz wrote:
Rewriting of inlined and external scripts is separately controlled, so you can do:

pagespeed EnableFilters rewrite_javascript_external;
pagespeed DisableFilters rewrite_javascript_internal;

See https://www.modpagespeed.com/doc/filter-js-minify for details.

Also is it possible to clean up your markup to remove that script tag? Does it have some benefit to some other system in your web stack?



On Sun, Jan 19, 2020 at 9:03 AM Longinos <longinos.in...@gmail.com> wrote:
Hi
These are not a external file but an inlined script.
Pagespeed recognizes <script  tag and try to optimize but the type of script (application+json) is not betwen the types pagespeed may optimize so throw the message.
Nothing is broken, only the warning message.
The only way I know is disabling all the javascript filters (Do you want that?) and the pagespeed don´t try to optimize any <script...

El domingo, 19 de enero de 2020, 0:04:39 (UTC+1), Richard escribió:
Hi, 

Got ngx_pagespeed working great on my WordPress site. But one nagging error keeps popping in PageSpeed messages log and it's Unrecognized script:'<script type="application/ld+json"></script>

I searched in entire Internet and can't find anything that could help me. 

If it's possible, is there a disallow feature that maybe I can turn on to skip this ld+json file?

Thanks,
Richard

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages