WordPress nightmare
“Could not load preview”

This first post for TuNegocioOnline is related to WordPress. It is very possible that you will find the solution somewhere else, but I searched and despite finding many sites in English describing it, I did not find any solutions and even less in Spanish.

Please know that my server is an Ubuntu Server with Apache, MySQL and PHP.

Wordpress nightmare

The first thing that jumps out at you when things start to go wrong in WordPress is this error when previewing:

“Could not load preview”

I was also unable to save changes.

Almost everywhere they say the usual things about deactivating plugins, etc, etc. Which is a good idea, but if after doing all that, the problem persists, what can be done?

A good option is to do a restore from a backup you may have. I use “UpdraftPlus” for daily backups and every two or three months I do another one to my hard drive with “All-inOne WP Migration”.

But in my case it made no difference. So I did a totally clean installation with an empty WordPress , I only installed the plugin “All-inOne WP Migration” and I did a restore from a copy of about three months old. To my surprise when the site was up and running the problem reappeared. The worst thing was that according to all the sites I found describing my situation said to forget that page and do it again. There was no solution.

As I knew it was not a plugin I suspected something wrong with the MySQL database that the restore was putting back. I had to find a way to not lose all the data but without using the original database code. I’m no database expert so I found a workaround by tinkering around.

These were the steps:

  • Create an empty and clean WordPress installation with your usual procedure that will have a different URL.
  • In my case I made sure that the database name and user were totally different from the original.
  • In the original damaged site go to Tools → Export . Say yes if it asks you to install the Worpress plugin, and then choose only the contents where you do have data. In my case it was “Entries”, “Pages” and “Media”.
  • Back on the new site, I activated the option to import from WordPress that comes in native mode (Tools → Import) and uploaded the above.
  • Then I activated the theme, which in my case is the Divi builder and tested for the problem. It was gone! I could do previews everywhere.

Then I had to make minor adjustments to the header and footer and reconfigure all the plugins. When everything was fine, using the “Search and Replace” plugin I changed the intermediate URL (the temporary one) to the good one and immediately after that I changed the Apache configuration so that the official URL of the page would point to the folder with the new installation.

All this happened to me at www.ahumada.es, which is now running perfectly.

Best regards,

Alejandro Ahumada.


Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.