WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
[resolved] Sitemaps not showing (7 posts)

  1. VenturaVan
    Member
    Posted 9 months ago #

    How do I tell Autoptimize to leave my sitemaps alone?

    http://wordpress.org/plugins/autoptimize/

  2. Frank Goossens
    Member
    Plugin Author

    Posted 9 months ago #

    Sitemap as in XML sitemap (seems to work OK for me using Google Sitemap Generator Plugin)?

    Or a sitemap for your visitors and if so; how is that built, using which plugin and what Autoptimize doing to it?

  3. VenturaVan
    Member
    Posted 9 months ago #

    I use Yoast SEO and Yoast Video plugins to create my sitemaps. The video one is fine. The main one appears as HTML if at all.

  4. Frank Goossens
    Member
    Plugin Author

    Posted 9 months ago #

    Installed Yoast SEO and all seems well on my test-blog.

    It does appear as HTML (as it does the XML sitemap plugin I use), but that's because the XML has a stylesheet defined that can render the XML as HTML.

    So as far as I can tell there really is no issue with Autoptimize & sitemaps, unless I'm missing something (in which case a link to your sitemap might help)?

  5. Frank Goossens
    Member
    Plugin Author

    Posted 9 months ago #

    I'm back ... ;-)

    Based on similar feedback from another user I decided to look into this some more. In that case using Autoptimize + Yoast SEO sitemaps + Quick Adsense resulted in blank sitemaps. I suppose you indeed meant just that, blank pages, when writing "if it appears at all"?

    Anyway; the following small code change will force Autoptimize to completely ignore sitemaps (or any other type of non-html thrown at it);

    Can you open up wp-content/plugins/autoptimize/autoptimize.php and around line 125 change;

    function autoptimize_end_buffering($content)
    {
        // load URL constants as late as possible to allow domain mapper to kick in
        if (function_exists(domain_mapping_siteurl)) {

    into

    function autoptimize_end_buffering($content)
    {
        if (strpos($content,"<html")===false){return $content;}
    
        // load URL constants as late as possible to allow domain mapper to kick in
        if (function_exists(domain_mapping_siteurl)) {

    Looking forward to your feedback!

  6. VenturaVan
    Member
    Posted 9 months ago #

    Not quite sure I did it right. Now getting a php error. Just friended you on FB so I can send you my php file via FB.

  7. Frank Goossens
    Member
    Plugin Author

    Posted 8 months ago #

    Hi VenturaVan;
    The fix we've been working on via mail is now in the test-build of Autoptimize 1.7.3, which you can download here. Looking forward to your feedback!

    frank

Reply

You must log in to post.

About this Plugin

About this Topic