This is a challenge for the sharpest and most experienced WordPress specialists

I am building a site in the WP Twenty Fifteen theme.

I created a bare-bones minimum home page at http://bit.ly/1zlmpKS

The first time you hit the page, it looks fine. When you refresh the browser you get a series of funny characters:

enter image description here

How can I fix this?

Amendment: Not sure how or if this relates and does what it does, but when I am logged into WordPress (as Super Admin) the home page never displays the funky characters. I can refresh and refresh and refresh dozens of times and it displays fine everytime. But the minute I logout of WP the home page shows the funny characters. I have an inner page on the new site as well, and it renders fine, consistently and all the time.

Background & History: I started out installing the Quark theme. Then I created my own "starter" child theme for the site. I could never get the child theme to take until, say hours later, all of a sudden my child theme started working. So I continued trying to tweak the child theme just to see if I could use it as a building block for my new site. Admittedly, this is my first crack at using the Quark starter theme and my first attempt to learn and utilize a child theme. Well after days of frustration, I thought maybe the W3 Total Cache plugin was the issue. So I network-deactivated it. Still no luck. Then I pulled out the child theme and the Quark theme and simply went with the WP out-of-the box Twenty Fifteen theme. That's when the funny characters surfaced. So I believe somehow and someway the W3 Total Cache plugin is messing with this network and the network site. I have dozens of other sites on my Multisite network install and none of them are misbehaving. W3 Total Cache is a standard plugin I activate for each new network I setup on my server. I have a shortlist of standard plugins I use across all networks and W3 Total Cache is one of them. Oh well...I am at a total loss.

Something else that's peculiar: When you hit the home page - it's fine. When you refresh the home page it renders the funny characters. But then if you wait for 5-10 mins and hit the home page again it renders fine. What might that mean in the WordPress world?

Next Trial & Error Test: I just re-installed Quark theme and network activated my Child Theme. The theme works -- so it is not a theme issue. The funny characters still appear on the home page on refresh under the Quark Child Theme. So it is some sort of unexplained caching issue, I think.

  • I'm out of my depth, but that you only receive these characters on subsequent loads makes me suspect some sort of cache failure. Do you have any plugins installed/have you tried disabling all plugins? I would also try disabling any caching features provided by your webserver. – bosco Feb 5 '15 at 22:36
  • I think boscho might be right. There are known issues tied to caching plugins causing garbled encoding problems. It's for sure a strange problem. If your not able to get it fixed, a fresh install may be the way to go. If you do decide to do a fresh install, make sure to delete the old install rather then just installing over it. – OnethingSimple Feb 5 '15 at 22:56
  • Not sure if it will help at all, but I inspected your http response headers for both cases and they are different. Maybe it will point you in the right direction. – awei Feb 6 '15 at 1:37
  • Thank you @boscho. I suspected it was cache too so I network deactivated the W3 Total Cache plugin which has never done anything for my sites but cause problems. Now I think the plugin is deactivated but I can't be 100% sure. how does one go about totally and completely deactivating the plugin on a network site? – tammy Feb 6 '15 at 2:18
  • Thanks @oneThingSimple. I can't do a fresh install because this site is a new network site added on to my WP Multisite system with dozens of sites in it already. BTW all the other sites run just fine and a number of them have the W3 Total Cache plugin activated. – tammy Feb 6 '15 at 2:20

Solved it thanks to [at]OnethingSimple and @milo.

It was the W3 Total Cache plugin. I removed it from my server and everything works fine.

Here's the path I had to take.

Step 1 - went into my network admin on the site having the problem to confirm that W3TC was not activate or network active -- and it was not.

Step 2 - walked through each of my other networks (over a dozen) to Network Deactivate the W3TC plugin -- again it is one of the standard plugins I install on every new network.

Here's was an interesting finding: enter image description here

Each network site showed this error screen. But I proceeded to Network Deactivate the W3TC plugin anyway on each and every one of my networks.

Step 4 - After network deactivating the plugin, I proceeded to Delete it from the network admin panel on my primary site. When I did, I got this error on screen:

W3 Total Cache Error: some files appear to be missing or out of place. Please re-install plugin or remove /home/abcdefg/public_html/wp-content/advanced-cache.php.W3 Total Cache Error: some files appear to be missing or out of place. Please re-install plugin or remove /home/abcdefg/public_html/wp-content/db.php.W3 Total Cache Error: some files appear to be missing or out of place. Please re-install plugin or remove /home/abcdefg/public_html/wp-content/object-cache.php.

So I looked at the Drop-ins plugins as shown below:

enter image description here

Step 5 - next I FTP'd onto my server and deleted these 3 files:

./wp-content/advanced-cache.php ./wp-content/db.php ./wp-content/object-cache.php

Step 6 - I tried to delete these 2 directories via FTP and could not. So I telnet'd into server as root and deleted them:

./wp-content/cache ./wp-content/w3tc-config

Step 7 - I then removed this line of code from wp-config.php:

define('WP_CACHE', true); // Added by W3 Total Cache

Step 8 - I then removed these blocks of directives from .htaccess:

# 2015-02-05 updated as part of install of W3 Total Cache Plugin
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
    RewriteRule .* - [E=W3TC_PREVIEW:_preview]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{REQUEST_URI} \/$
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html" -f
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html" [L]
# END W3TC Page Cache core

# 2014-09-18 added as part of install of W3 Total Cache Plugin
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
# END W3TC Browser Cache

Step 9 - refreshed the home page on the site numerous, numerous times. NO MORE FUNNY CHARACTERS !!!

  • Awesome @tammy! Glad you got it worked out - thanks for taking the time to share your process and solution. W3 Total Cache can do some pretty awesome things, but getting it and your server environment configured properly can take a lot of time, research, and head-scratching - thus why both the developer as well as third parties sometimes offer to configure the plugin for a premium! If you ever go back, I recommend starting small and building upwards - disable every W3TC feature and enable them one at a time, examining every configuration option and verifying stability each step of the way. – bosco Feb 11 '15 at 4:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.