How to Delete All Files from a WordPress Website and Start Over

You decide to switch websites and discover that your previous website files are still present. Maybe you have just recently built a new blog or just updated a website with new content. Regardless, you want to start fresh and delete all the existing files to save you both time and effort. So how do you go about deleting all the files? Let’s take a look.

The Rerun Approach

It is always a good idea to backup your website before making any changes. Especially if you run a business online, the possibility of data loss is very high. By copying and pasting all the content into a new document you can be sure that you will not lose a single piece of information. Many platforms, such as Git, provide you with multiple saves so you do not have to worry about accidentally overwriting something.

Once you have made a backup of your website you can move forward with the tedious task of removing all the existing files. You might want to do this during a quiet period, either at night or on a weekend, to give yourself plenty of time to get everything done. This will help prevent any complications caused by unexpected traffic spikes.

The first step is to locate all the files that make up your website. You can do this by navigating to the directory where your website files are located and then viewing the files with your web browser. You do not have to download or install any special software to find these files, as most operating systems provide you with a graphical interface for navigating your filesystem (file system).

Locating the files is only the first step, you then need to identify what you will do with these files once you have located them. You can think of this stage as deciding what to delete.

Delete Unnecessary Files

Once you have located the files you can start by deleting any files that you do not need. Some examples of unnecessary files are:

  • The wp-config.php file – this file contains information about your site which can be found in the WordPress docs.
  • Any files ending in.htaccess – these files are used to control the behavior of your website (more on this later).
  • The robots.txt file – this file is used to control access to your site by search engine robots.
  • The favicon.ico file – this file is used to display a small icon (favicon) on your site which is particularly useful for browsers.
  • The empty pages – when you navigate to your site in a web browser you will often see a page with the words “404 Not Found”. This is because you do not have any content on that page. You can either insert a brand new page with content or just delete that page entirely.
  • The.DS_Store files – these are hidden files stored inside your website’s directory. They are there to store small bits of data that your operating system needs to function properly. You can remove these files if you are happy having your site display only web content without any of your files or extensions being stored in the browser.
  • The.php files – these are the files that make up your site’s source code. You do not need to keep these files as they are just a template for when someone visits your site. You can either delete them or move them to another directory where they will not be accessed by the public.
  • The HTML files – these are the files that make up your site’s actual content. You can either keep them or remove them, however some people prefer to keep the HTML files as it makes for easy reading through the source code. It is a good idea to keep the HTML files as they can be easily accessed and downloaded by anyone.

There are many other unnecessary files that you can delete, you just need to figure out what you will do with them. Once you have located these files you can start identifying what you will do (delete them) with the intention of starting fresh.

Delete Content That Is Not Necessary

Once you have removed all the unnecessary files you can start eliminating content that is not necessary. This is simply content that you do not need and have no use for. Sometimes you will want to keep certain content for SEO purposes, however you should not overuse this feature as it could potentially hurt your website’s search engine rankings. Remember, the goal is to provide relevant content to your users without the need for search engines to find it.

You should start by removing any content from posts or pages that are not actively being used. This can be difficult to determine so you might want to write down a list of keywords and phrases to use to find these pages and posts. You can then use the find and replace feature in your text editor to replace these keywords and phrases with relevant content. Once this content is in place you can start to think about removing the rest.

Organize And Backup Your Files

You have now reached the final stage of removing all the files from your WordPress website. It is important to back up any important files that you have left before starting to make changes. This is particularly important if you are switching to a new domain or hosting service. Changing the domain name of your website or the web server (host) on which your website resides can be a bit tricky and error-prone if you have not done so before. Make sure that you test out your new domain name (or hosting service) before making any significant changes.

If you have copied and pasted all your content into a new document then you can simply delete that document and start over with a new one. Remember to keep a backup of all your important files in case anything goes wrong.

WordPress itself provides you with a great deal of flexibility when it comes to creating and running a website. The fact that it is open source software provides you with the freedom to learn more about how things work behind the scenes and, if necessary, change them. Many websites are still active and being used daily thanks to the flexibility provided by WordPress.