• Resolved userwords

    (@userwords)


    From this thread

    https://wordpress.org/support/topic/facebook-tag-fbadmins-not-working-in-yoast-but-does-in-another-plugin?replies=2#post-7651253

    After lot of tries ive proved that option under Autoptimize

    Inline and Defer CSS? Inline “above the fold CSS” while loading the main autoptimized CSS only after page load. Check the FAQ before activating this option!

    Makes Yoast social tab option

    Facebook Insights and Admins

    To not work.

    Apparently yoast adds the facebook tag after all the inline css of autoptimize, and facebook refuses to read so much code. It does not read until the closing header tag. So if you deactivate de inline css the the yoast facebook tag is almost at the beggining of the header and it works, but if you enable the inline css above the fold in autoptimize yoast tag ends after the inline css and thats a lot of code so facebook stops reading and shows an error as if the tag werent there, even though it is actually there but after all that css code.

    So, ive disabled it for the moment but i tell you to know and maybe say if you will be somehow moving all the inline css to the very end of the header so no tag endes trapped bellow all that code, or maybe you see any other solution on your side im missing.

    Greetings.

    https://wordpress.org/plugins/autoptimize/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Frank Goossens

    (@futtta)

    well, the amount of inlined CSS for “inline & defer” actually depends on what you enter in the “above the fold CSS”-box on the autoptimize settings page.

    the same problem might arise when using the “inline CSS”-option by the way.

    regarding the place where CSS in inlined; you can change that using the API, so maybe that way you can force it beneath the Yoast FB-tag by doing e.g.:

    add_filter('autoptimize_filter_css_replacetag','yoast_override_css_replacetag',10,1);
    function yoast_override_css_replacetag($replacetag) {
    	return array("</head>","before");
    	}

    hope this helps,
    frank

    Thread Starter userwords

    (@userwords)

    Thank you very much. Im reviewing it, as apparently i had too much css in the inline and defer box. Speed in fact improved upon disabling this option considering how much css i was inlining in the header. At least i discovered there is a lazy point limit for facebook tag. Thank you very much for reaching ill test the filter.

    Hi,

    Where can we the filter?

    Thanks

    Plugin Author Frank Goossens

    (@futtta)

    the code that uses the filter is here jumairmacabago, you can use the code snippets plugin to add it to your site.

    enjoy the weekend! 🙂
    frank

    Whooahh.. it fixed the problem. Thank you so much Frank. God bless you and your family. I love your work… Thank you..

    Hi Frank,

    I came back because I’ve seen an error. Is there a way for me to put the critical css below the <!– / Yoast SEO plugin. –>

    It turn out that the css was move to the lowest and affecting my website mobile view.

    My website: maranaolyrics.com

    I deactivate the snippet filter for now. 🙂 Thank you.

    Plugin Author Frank Goossens

    (@futtta)

    well, I guess you could try;

    add_filter('autoptimize_filter_css_replacetag','yoast_override_css_replacetag',10,1);
    function yoast_override_css_replacetag($replacetag) {
    	return array("<!-- / Yoast SEO plugin. -->","after");
    	}

    Thank you, that’s what I did right before I check your reply. Hehehe Will it not affect the Yoast SEO performance? I just want to be sure that’s why I’m listening to you. You are the expert. 🙂 Hehehe.. God bless Frank, fast reply as always.

    Plugin Author Frank Goossens

    (@futtta)

    Will it not affect the Yoast SEO performance?

    well, this way the critical css is right after yoast’s code, so it should nott affect yoast no 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Autoptimize Insiline Defer Css prevents Yoast Seo Facebook tag from working’ is closed to new replies.