• Resolved audioprolabs

    (@audioprolabs)


    I am writing to you because I have a question. After activating the option Aggregate all linked CSS-files and looking at the source code of a post or page, I can see that autoptimize is changing the source code of the page and pushing the <title> of this page of the end of the code. In other words, autoptimize is creating a code like this <link media=”all” href=”https://audioprolabs.com/wp-content/cache/autoptimize/css/autoptimize_23b10388e4cd190d30ebd1aeaa49e186.css&#8221; that makes the <title> at the end of this code line. Disabling the aggregate all linked CSS-files option the code is fine, but I do not want to disable this option because this is creating many Render blocking resources. I have another page with the autoptimize plugin and this is not happening. You can see the attached images to better understand what I mean. I am worried that Google can not see the title of this page or post because of this change created by autoptimize. Is there a way to solve this?
    Regards

    Image 1

    Image 2

    • This topic was modified 1 year, 10 months ago by audioprolabs.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    AO by default indeed injects the aggregated CSS in front of the title tag, but if you scroll the screen with HTML source to the right (or tick the “ajuste de linea” option) you’ll see the title is still there.

    If however you want to change where AO injects the aggregated CSS, you can do so with a code snippet, below an example to add it _after_ the title;

    add_filter( 'autoptimize_filter_css_replacetag', 'css_after_title', 10, 1 );
    function css_after_title( $replacetag ) {
        return array( '</title>', 'after' );
    }

    hope this helps,
    frank

    Thread Starter audioprolabs

    (@audioprolabs)

    Thank you very much Frank for your reply! I know that the name is present, but I wanted it to be at the beginning. I just wanted to ask where I have to insert this code? Thanks in advance

    • This reply was modified 1 year, 10 months ago by audioprolabs.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    The easiest & safest solution is using the code snippets plugin 🙂

    Thread Starter audioprolabs

    (@audioprolabs)

    Ok, thank you. I have inserted the code directly on the functions.php file and everything seems fine now. Thank you for your time Frank and for the excellent plugin.
    Best Regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here

    have a nice weekend 🙂
    frank

    I am trying to load “AO above the fold css” after the yoast tags but failed every time. Could you please help me how to load the css after yoast tags?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Pushing the Title of the page on the end of the code’ is closed to new replies.