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' );

The best Genesis news site around (thedailybolt)

I recently stumbled on a Genesis news site (thedailybolt) that is quickly becoming a favourite place for me to keep updated on StudioPress/Genesis and WordPress in general. The site serves as an aggregator of articles posted on a variety of other websites. It simplifies the process of trying to keep up with the constant rush of news and information about Genesis by pulling all of the articles together and keeping them in one place.

You can visit the site here, and see what sites they pull articles from here.

If you work with Genesis or WordPress it’s definitely worth a look!

New website for Mennonite Trust Ltd.

We recently launched a brand new website for Mennonite Trust Ltd.

Since 1917 Mennonite Trust Ltd. has been in the business of providing financial and estate services from a Christian perspective. Formed as a joint partnership between Mennonite Church Saskatchewan, the Saskatchewan Conference of Mennonite Brethren Churches and the Fellowship of Evangelical Bible Churches, Mennonite Trust Ltd. is a truly Christian business with a genuine Christian perspective.

Mennonite Trust Ltd. has offices in Waldheim, Saskatoon, and Swift Current.
You can visit their new site here!

Help limit WordPress comment spam with your .htaccess file

Many spambots will visit wp-comments-post.php directly to comment on your WordPress site instead of actually going through a post. You can combat this type of spam by modify the .htaccess file of your WordPress site with the following code:


RewriteEngine On
RewriteCond %{REQUEST_URI} .wp-comments-post.php*
RewriteCond %{HTTP_REFERER} !.*mydomain.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

Note: You will need to replace mydomain with your domain name with no prefix.


RewriteCond %{HTTP_REFERER} !.** [OR]

How to include WordPress shortcodes outside of the Loop or in a Template

Shortcodes are a great way to quickly add many different types of functions within pages or posts on your WordPress site. Many plugins and WordPress itself include shortcodes to access their functionality. You can also create your own shortcodes by writing your own plugins or adding to your themes functions.php. Now there are occasions when it is handy to include shortcodes in WordPress page/post templates or within WordPress theme files. You can quickly add a shortcode into any php file with the following code:

echo do_shortcode("[shortcode]");

World Backup Day

For those of you who don’t know, today March 31st is World Backup Day. In our increasingly digitized world, keeping your data safe and secure both professionally and personally becomes increasingly important!

Today I received an email from Host Gator with the following stats:

  • All hard drives will crash during their lifetime
  • More than 1 in 10 laptops will be stolen in their lifetime
  • A laptop is stolen every 53 seconds
  • Every year 46% of computer users lose their music, photos, and documents
  • 50% of all hard drives will crash within 5 years
  • 89.1% of PC users don’t perform regular backups
  • A recent study from Gartner, Inc., found that 90 percent of companies that experience data loss go out of business within two years.
  • 70 percent of companies go out of business after a major data loss

If you are not regularly backing up your files please take the time to find and setup a backup solution. You can read a number of articles on how to backup your computer at

Personally I use a mixture of Rsync and Rsnapshot to backup both my personal and business data. I love the amount of control I have over the backup process, and the fact that none of my data is stored in a proprietary format that locks me into one company or program.

If you aren’t backing up your website can help you setup an automatic, easy to use solution.

Modify WordPress AutoSave interval

WordPress automatically saves revisions to your posts and pages every 60 seconds. You are able to modify decrease the time interval if you’d like to reduce the chance of losing changes or increase it to cut down on the load to your database.

You can change the autosave frequency by adding the one of the following lines to the site’s wp-config.php file.


/* Set AutoSave to 30 Seconds */
define ('AUTOSAVE_INTERVAL', 30); 
/* Set AutoSave to 5 Minutes */
define ('AUTOSAVE_INTERVAL', 300); 

Redirecting your website to a new domain

Have you ever needed to move your website to a new domain? This can be a tricky thing to do without breaking all the links to your website that exist in emails, print media, Facebook, or anywhere else on the internet. It is possible to redirect all incoming links with a piece of .htaccess code that will keep all your old links working.

.htaccess Code

RewriteEngine On
RewriteBase /

# New code to redirect from to
# Permanent redirect for caching purposes, also include the query string
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=permanent,QSA,L]

# New code to redirect from to
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=permanent,QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Replace with your old domain name, and with your new domain name. This will redirect all links that go to your old domain to your new domain.

Link Examples
Takes you too
Takes you too

Limiting the number of post/page revisions that are saved in WordPress

Whenever you modify a post or page on your WordPress site, a copy of is saved to make it possible to revert any changes that have been made.  Although this is a great feature when you quickly need to revert site content, the number of revisions can quickly add up and begin to take up a large amount of space in your database.  It is possible to set a maximum number of revisions that will be saved for each post/page by adding the following snippet to wp-config.php


/* keep a maximum of 5 revisions for each post/page */
define('WP_POST_REVISIONS', 5);
/* disable revisions for post/pages */
define('WP_POST_REVISIONS', 9);

Empty WordPress trash automatically

Ever since the release of version 2.9 WordPress automatically deletes posts, pages, attachments, and comments, from the trash bin every 30 days. You are able to change this default behaviour by adding a snippet of code to the wp-config.php file of your WordPress install. This can be handy if you want to empty the trash more often to save space, or if you want to disable the trash altogether.

The following snippet would empty the trash every 7 days. You can set this to whatever number works best for you or even 0 to disable the trash feature completely.


define('EMPTY_TRASH_DAYS', 7 );