How To Redirect Nonexistent Blogs in WordPress Multisite

How To Redirect Nonexistent Blogs in WordPress Multisite

Don’t let your visitors arrive at a dead end.

On a very active WordPress multisite network, blogs can come and go. Perhaps a user hasn’t renewed his membership or simply decided to delete his blog. Other sites may still be linking to that nonexistent blog. The default behavior of WordPress is to direct you to a 404 error page when you try to visit a nonexistent blog. Unless you’ve taken great care to make your 404 error page useful and engaging, the visitor has probably reached a dead end.

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

Did you know that WordPress has a NOBLOGREDIRECT constant that you can use to customize the URL it redirects to for nonexistent blogs? Add this to your wp-config.php file and change the URL to wherever you want to send your visitors.

define('NOBLOGREDIRECT', 'http://example.com');

Using this handy constant you can redirect to your home URL, a blog directory or any page that you think might help to get your visitor interested in staying on your site.

This is one of those really easy customizations that improves a new visitors experience on your website. Instead of landing on a 404 error page, the user can be sent to a more engaging page with information about your network. Any WordPress multisite admin can implement this quick customization in less than a minute.