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.

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 only be supplied with updates. A new plug-in is installed or deleted at most times. But there are also reasons for a complete reinstallation 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 overtime or with future updates. A new installation can be the method of choice here.

Reinstallation should be the last resort

In many cases, it is not necessary to reinstall WordPress at a 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 through 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 a clean website.

Reinstall WordPress

Below you will find all the steps necessary to back up the contents 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. You can do this with just a few clicks of the mouse with the Duplicator plug-in. 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. This export function can be used to download all articles, pages, comments, categories, tags, and menus 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, if you have previously noticed links to strange domains in your posts, you should open the XML file once with a text editor. Then you can look for those 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 have 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 the reinstallation, 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 saved.

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 note the settings 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 carry out 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 webspace 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 recreate it. You can do this in the customer menu of your web host.

6. Reinstall WordPress

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

Then install the theme you want and the plugins you need. 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 must then be installed by clicking on the link.

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 a 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 the installation. However, it does not remove any files on the webserver.

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.

Leave a Reply

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

Author

Latest Posts

Categories