Illustrations for the article

WP Multisite – old installation and subdirectory install

How to, Snippets, WP Multisite

The Problem

You need to transform your WP site into multisite, and you have already added define (‘WP_ALLOW_MULTISITE’, true); to wp-config.php. But you’ve received the following message:

Because your install is not new, the sites in your WordPress network must use sub-domains. The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.

However, you don’t want to install WP multisite on different subdomains, and you plan to solve the permalinks issue with redirects.

How do you fix it that way? WordPress‘ hidden, built-in function won’t allow you to choose.

The Solution

The solution is quite simple. Just paste the following code snippet into your functions.php:

That’s it. Try it, and you should see a radio choice between subdirectory and subdomain install. When you are done with WP Multisite, go ahead and delete the snippet to keep your site clean.

Comments (2)

Leave a Reply

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