With the basics of managing a multi-site network under your belt,
it's time to look at some more advanced multi-site management tasks.
Let's dive into the different possible site statuses,
what happens when you delete a site, how to export a single site from a multi-site network
to its own install, and how to convert a multi-site network install back to a single site install.
There are some site status options that are available to the network admin that are used
for the network admin.
They are also useful to know about.
Deactivating a site will update the site status to be deleted
and shows a message to anyone visiting the site.
Additionally, there is a deactivate blog action hook that is fired when a site is deactivated
and an activate blog action hook that is fired when a site is activated
that can be used to run additional functionality when a site is activated or deactivated.
Archiving a site will update the site status to archived
and show an archive message to anyone visiting the site you are on.
But no additional action hooks are fired.
Finally, marking a site to spam will update the site status to spam
and show the same message as archiving.
But again, no additional hooks are fired.
Deleting a site from the network will remove all content associated with that site,
including posts, pages, comments and any other custom content types.
It also removes any tables in the database that were used to house the site's content.
Unlike when you trash a post or page, once you delete a site, you cannot undo this action.
Under certain circumstances, you might want to extract one of the subsites
to its own single site WordPress install.
This is possible, but requires some manual steps.
There are a few ways to do this.
We'll just cover one possibility.
First, in the network admin, switch to the subsites dashboard.
Then browse to the tools export page.
Here you can use the WordPress export tool to export the content
to the WordPress Extended RSS or WXR format.
Then create the new single site and the associated user.
Once you've created the site, make sure to install any plugins or themes
that were used on the sub site.
Then browse to tools import and use the WordPress importer to import the data into the new site.
First, install it and then click run importer.
Choose the file you just created from the export and click upload file and import.
Lastly, make sure to assign the data to the correct user.
Once the data is imported, manually copy the uploads directory for the sub site
over to the new single site install.
You will find the sub site uploads directory in the WP content uploads sites directory
of the multi-site install in a folder with the same name as the sub site ID.
Last but not least, install and run a search replace tool like
better search replace to update any URLs in the database.
You will need to search for and replace the sub site URL with the new single site URL.
If you were pointing a top level domain to the sub site, this last step might not be necessary.
Finally, make sure to test everything out and make sure it's working as expected.
An alternative to the WordPress data export option is to manually copy the database tables
for the sub site to the new site.
However, this might lead to further issues if the content isn't associated with the correct user.
If you have any plugins that create custom database tables,
you might need to manually copy these tables over to the new installation.
In that case, it might be easier to rely on paid third party backup solutions that have
multi-site extensions and will handle this for you.
It's also possible to convert a multi-site back to a single site install.
This is useful if you no longer need the multi-site functionality,
but want to retain the original site.
If you have other sub sites, it might be a good idea to export them to single site installs first
and then delete the sub sites as this will delete the sub site content tables.
Additionally, delete any users that were created for the sub sites.
To revert back to a single site, you first need to remove all the multi-site related
constants in the WP config file.
Once you do this and refresh your dashboard,
it will revert back to a single site install. You might need to log in again.
If you see this message, it's because you're trying to access an admin URL for the network
admin. In that case, simply change the URL to the regular WP admin path.
Then if you previously updated the HD access file, you will need to revert that back to the
original HD access file. You can do this by resetting the permalinks to whatever you want them to be.
As you can see, this resets the HD access file.
If everything went well, you should now have a working single site install
of your original main site. For a full list of all the multi-site
management functionality, check out the multi-site section in the WordPress developer handbook under
advanced administration.