Deletes the reinstallation of WordPress content

Reinstall WordPress from scratch (even without data loss)

In most cases, WordPress is installed once at the start of a website and from then on it is kept up to date using the update function. But there can also be situations in which you want to completely reset your WordPress installation and reinstall it. Here you can find out how you can set up WordPress from scratch and even import your old content again if necessary.

Table of Contents

Reasons to reinstall

Normally, WordPress is set up and set up once at the start of a web project. From this point on, the content will be created and the WordPress system will be only supplied with updates. A new plug-in is installed or deleted at most times. But there are also reasons for a complete new installation of WordPress on an existing website:

  • Realignment of the page
  • Broken configuration
  • Hacker attack

It can happen that you start a web project with a certain content orientation, but then realize after a while that you would rather go in a different direction. In many cases, the WordPress site should then be completely restarted with a different theme and different content.

If you have tried a lot of different plugins, entries are often left in the database even after deactivation. Even if you make a lot of manual changes to configuration files, errors can creep in over time or with future updates. A new installation can be the method of choice here.

A new installation should be the last resort

In many cases, it is not necessary to reinstall WordPress at second glance. Especially when realigning a project, you should check whether you cannot adapt the existing WordPress installation accordingly. Many configuration errors can also be corrected without reinstalling.

If your own WordPress site is infected via a security hole, malicious code could have been smuggled into individual files on the server or into the database. If there is no longer a backup from the time before the attack, a new installation is usually the only way back to one clean Website.

Reinstall WordPress

Below you will find all the steps necessary to back up the content of your existing WordPress installation and then delete WordPress and reinstall it.

Important: These instructions only apply to simple WordPress sites. There can be no general procedure for extensive pages with infrastructure plugins, child themes, custom styles and other adjustments.

1. Create a backup

Even if we back up all content from WordPress in the following steps, I recommend creating a backup of the current status quo. This is done with just a few clicks of the mouse with the Duplicator plugin. You should then download the backup created in the form of a zip archive to your computer. This gives you the option of restoring the previous status in an emergency.

2. Export data

WordPress comes with an export function for the created content. You can find this in the backend under Tools> Export Data. With this export function all contributions, pages, comments, categories, tags and menus can be downloaded in a special XML format.

In the case of an infected WordPress site, you should check the XML file for malicious code with a virus scanner. For example, did you previously have links to strange domains found in your posts, you should open the XML file once with a text editor. Then you can search for these links and remove them.

3. Save uploads

The previously created export file does not contain the images and downloads uploaded via the media library in the WordPress directory / wp-content / uploads /. To secure this, you should log into your web space via FTP and download the directory to your computer.

In the case of an infected WordPress site, you should definitely check this directory with a virus scanner. In this way you can ensure that none of the files has been infected with malicious code. Also, only the files you uploaded should really be in the directory. .Php files that can be executed by the server normally have no place in the directory.

4. Save theme and plugin settings

If you want the website to appear with the same look and feel after reinstalling, you have to make a note of which theme and which plugins you are currently using. The settings of the theme and plugins must also be secured become.

Many premium themes such as Divi or extensive plugins such as Yoast SEO offer an export function to save the settings. This is not possible with simple themes and plugins, here you have to write down the settings you have made or simply take screenshots of them.

5. Delete WordPress

After you have exported and saved all data, you can now delete the existing WordPress installation. Important: If you follow this step, your website will no longer be accessible. If visitors come to your site via links or search engines, they will see an error message.

If you want to continue deleting, log into your web space and delete all files in the root directory of your domain. In order to start with an empty database after the new installation, you must also empty the existing database or delete and create a new one. You can do this in the customer menu of your web host.

6. Reinstall WordPress

Now you can reinstall WordPress on your web space. The individual steps for this are identical to the initial WordPress installation.

Then install the theme you want and your required plugins. You can then import the relevant settings or make them manually as you noted them down or as screenshots.

7. Import data

You can now re-import the posts, pages, comments, categories, tags and menus that were exported at the beginning. You can find the import function in the backend under Tools> Import Data. The importer then has to click on the link Installed become.

The XML file is a text file that you can open and edit in any editor. For example, you could remove certain posts so that they are not imported again.

8. Check the URL structure

After reinstalling WordPress and importing your posts and pages, you should check the URL structure. The permalink settings should be set in the same way as before the new installation. Otherwise, existing links to your posts would come to nothing. If you want to consciously change the URL structure, you should forward the old URLs to the new version.

Reset WordPress via plugin

If you just want to reset the database, you can also use the WordPress plugin WP Reset. This can be used to reset the database to its original state after installation. However, it does not remove any files on the web server.

Conclusion

With the steps mentioned you can delete WordPress and then reinstall it. With previous export and backup of all settings and contents, a new installation is even possible without data loss. But you should consider beforehand whether a complete reinstallation is really necessary in your case.