SEO by Yoast + W3 Total Cache – A Troubled Relationship

SEO by Yoast + W3 Total Cache can lead to a rocky start

So I ran into a little issue with the above two plugins playing nice. Hopefully I can save some others the frustration and Googling I went through to resolve it.

The Deets (for muh peeps)

WordPress SEO by Yoast – Great SEO plugin does a ton of things automatically. Fantastic overall if you want to make various search engines happy and take advantage of things like Google Webmaster tools.

W3 Total Cache – Another fantastic plugin, helps cache (as the name might imply) aspects of your site along with optimizing code on the fly.

However you put these two together and you’ll only get part functionality, mainly W3 Total Cache wins. One of the features that SEO by Yoast brings is the ability to create a Google compliment XML site-map. However Google expects this to be served up in wait for it… XML. W3 Total Cache goes and caches the XML page and serves up a static HTML page which in turn makes Google a sad panda. As in they won’t index your site, which is bad news if you want the populace of the internet to find you.

The Fix

Long story short we need to get W3 Total Cache to leave the SEO XML pages alone and un-mangled. In order to do this we just need to exclude them from the caching process. First figure out the page names (Yes I know I could use reg-ex to do this I just like explicit control in this case.) for your XML site-map.

  1. Go into the SEO Plugin > XML Sitemaps.
  2. Click the XML Sitemap button.
  3. Make note of all the .XML file names these are what we want to exclude. For example:
    1. post-sitemap.xml
    2. page-sitemap.xml
    3. category-sitemap.xml
    4. author-sitemap.xml
  4. Next go into the Performance Plugin, you’ll need to exclude the pages above in the following sections.
    1. Page Cache
    2. Minify
    3. Database Cache
  5. Also make sure 

 

And there you have it. Follow these steps and you can have the best of both worlds, caching and SEO magic. Happy WordPressing! (that’s a verb right?)

Permanent link to this article: https://tripplehelix.net/seo-yoast-w3-total-cache-troubled-relationship/

1 comment

  1. Obrigado!!!

Leave a Reply