WordPress turns off multisite mode

This article is the eighth article of the topic “WordPress Multisite”, with 8 articles in total:
  • How (and when) to use WordPress for customer projects
  • WordPress enables multiple sites (including Apache and Nginx pseudo-static rules)
  • Add/remove the default page of WordPress network
  • WordPress network clone website data and settings
  • WordPress multi-site network sharing of pictures and media files
  • WordPress multi-site network plugin and theme detection: Network Plugin Auditor
  • Change the file types and sizes that can be uploaded to the WordPress network
  • WordPress turns off mode

WordPress 3.0+ can directly enable multi-site mode. If you want to enable it, please check: WordPress Enable Multi-site (including Apache and Nginx pseudo-static rules). Let me briefly talk about it today. If you turn off the multi-site mode, restore the main site to a single site (the main site is the default site before you turn on the multi-site mode).

Before you start, you have to back up the entire database and all files , and then find a way to restore all sites other than the main site to other places, or switch to single site mode . This step will not be introduced here, but you must do it yourself! ! It is recommended to read WordPress to enable multi-site (including Apache and Nginx pseudo-static rules), because many are reversed.

1. all plug-ins and delete all sites except the main site (remember to back up or migrate these sites, the deletion operation will delete related data)

2. Delete the configuration code added to wp-config.php to enable multi-site (similar to the following code:)

define ( 'WP_ALLOW_MULTISITE' ,  true ) ;
define ( 'MULTISITE' ,  true ) ; 
define ( 'SUBDOMAIN_INSTALL' ,  true ) ; 
define ( 'DOMAIN_CURRENT_SITE' ,  'yourdomain.com' ) ; 
define ( 'PATH_CURRENT_SITE' ,  '/' ) ; 
define ( 'SITE_ID_CURRENT_SITE' ,  1 ) ; 
define ( 'BLOG_ID_CURRENT_SITE' ,  1 ) ;

At this time, log in to the background and you will find that you have returned to single site mode

3. Clear the pseudo-static rules for multiple sites: If it is an Apache environment, please delete the rule code added to .htaccess; if it is an Nginx environment, please delete the code that adds the conf configuration file. For details, please check the previous WordPress Open Multisite (including Apache and Nginx pseudo-static rules). Visit the website backend and reset the permalink structure.

4. Turn on the required plug-in, and normal access to the main site should be restored. But it is still recommended to log in to phpMyAdmin to delete redundant database tables:

  • wp_blogs
  • wp_blog_versions
  • wp_registration_log
  • wp_signups
  • wp_site
  • wp_sitemeta
  • And the spam and deleted fields under wp_users

Note: The example here is the default database prefix wp_, please operate according to your actual database prefix.

It is very simple to delete the first 6 databases, select them directly, and then delete them:


If you don’t know how to operate phpMyAdmin, please read the phpMyAdmin tutorial first.

To delete the spam and deleted fields under wp_users, you need to enter wp_users and then execute the SQL command.

Delete the spam field:

ALTER  TABLE wp_users 

Delete the deleted field:

ALTER  TABLE wp_users 
 DROP  COLUMN deleted

For deleting or adding a field in a database table, please refer to http://www.w3school.com.cn/sql/sql_alter.asp


Here, everything is OK!