Resolving migration issues after renaming wp-content

I recently ran into a strange issue after performing a clone of a WordPress site using Infinite WordPress (my preferred WordPress management platform). The clone had worked great and I logged in and started to modify the new site. I quickly noticed something was wrong after WordPress admin panel started generating 404 errors. When I looked at the source code for the page it looked like I was still trying to load a number of CSS and JS files from the site I had cloned from. My first thought was that there was an issue with the clone and the old domain name was still being referenced in the database. I searched the database but everything seemed to be fine.

The Solution

Finally while looking for the cause of the problem I noticed that there were two lines at the top of my wp-config file that referenced the old domain name and old website install location. These two lines were added when I renamed the wp-content folder on the original site. I quickly updated the code to point to my new site and I was off an running. This is something to be aware of when using automated WordPress migration tools, they don’t always catch all references to the original site. I really like using the cloning functionality in Infinite WordPress and this doesn’t cause an issue as long as you are aware of the problem and include it in your work flow.

 More on Renaming wp-Content

If anyone is interested in renaming their wp-content folder either for security reasons or just so your site looks less like WordPress, take a look at the iThemes Security Plugin. The plugin will do it automatically for you along with allowing a ton of other security tweaks. Please make sure you back up your website before trying though!


For those who are interested the two lines I needed to change were something like this (where site-assets would be the new name for wp-content)

define( 'WP_CONTENT_URL', '' );
define( 'WP_CONTENT_DIR', '/home/mennosites/public_html/site-assets' );