• Resolved Huy Hoa

    (@huyhoanet)


    Hi,
    Thanks for your optimized plugin. I have a problem need your help please.
    I have a script something like this: (of course this is not full code but the start of the snippet)

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

    When i added it in the header.php then SGOptimized automaticcly move it to footer then it dupplicated and then one in header and one in footer.
    If i move that code to footer, then it will be ok, only one in the footer.
    So, now i want to put it in the header.php and exclude it from moving to footer and i use this snippet.

    add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
    function js_combine_exclude_inline_script( $exclude_list ) {
        $exclude_list[] = '<script type="application/ld+json">{"@context":"https://schema.org","@type":"CreativeWorkSeries"';
        return $exclude_list;
    }

    But there is no change. Could you please check if i did something wrong?
    Thank you so much

    • This topic was modified 3 years, 2 months ago by Huy Hoa.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @huyhoanet,

    This script should not be combined, because when checking the inline scripts, we skip the ones that do not have an src attributes.

    Would it be possible to provide a site URL, so we can investigate the issue in detail and locate the exact issue for that behavior?

    Kind regards,
    Stoyan

    Thread Starter Huy Hoa

    (@huyhoanet)

    Would it be possible to provide a site URL, so we can investigate the issue in detail and locate the exact issue for that behavior?

    Hi, Stoyan
    Thanks for your support.
    I don’t want to show it here, so, which email should I send to? Or can I create a ticket inside my Siteground account?

    Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    We can’t communicate over the email, since it’s against the rules. Please, open another thread and provide your site URL in it if you want us to look further into this. It will be unavailable for bots and unregistered users anyway if that’s the concern. Otherwise, I am afraid we can’t assist you further.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude javascript from optimize’ is closed to new replies.