How to convert a WordPress website into a static website in a few clicks

php code

Surely when we talk about static WordPress it may seem complicated to do, but in reality, there are ways to do it quickly and easily.

Is about converting a dynamic WordPress website, to a static HTML website, which is what we are going to learn to do with this guide, in a very simple way.

Why would I want to make a WordPress website static?

There are many reasons that come to mind, but the main one is when we have a website that will not have updates, new content, or comments, you just want it to continue to exist, but without requiring attention and updates on your part.

You might think that if the website is going to be static, why make it with WordPress, but this question answers itself: for convenience.

The great advantage of WordPress is that it allows you to quickly create attractive and complete websites with zero knowledge of code, and any Internet professional, such as a marketing manager, can create websites for their campaigns, just with WordPress and a couple of plugins, without having to resort to the programming department or an external developer.

Then if we can convert that website to static so that we don’t have to maintain it, then it’s a closed circle. The best of WordPress (speed and simplicity) without the worst of WordPress (having to maintain it).

Advantages of a static website

Serving a static copy of your WordPress website has some advantages, and some I have already pointed out in the previous section, but I will summarize with these:

  • Speed: A static web doesn’t have to make queries to the database or resource repositories to be displayed, it is always available. A static web is always faster than a dynamic web, period.
  • Performance: Since it does not require any type of query, it is also optimal in terms of server resource consumption.
  • Security: As there are no dynamic elements or PHP code to execute, it is much easier to secure, as it does not depend on updates. Nor will you suffer from SQL injection attempts, remote dynamic executions or similar. You practically only have to protect the file system.

Disadvantages of a static website

They are the reasons why you wouldn’t want a static website(needing to add updates or updated content) because that is not its purpose:

  • Online store.
  • Forums.
  • Memberships.
  • Comments.

How do I make a WordPress website static?

What we have to achieve is to make a static copy of your website, which will be a collection of files: HTML, CSS, JS, images, etc.

To do this we are going to use a plugin, Simply Static, very easy to use. Let’s take it step by step, you will see how easy it is.

Install the plugin on the current WordPress site

The first step is to install the Simply Static plugin on the WordPress website you want to make static.

No mystery, install it as you would install any WordPress plugin.

plugin directory

Create the folder for temporary static files

Although it is not specified in the plugin documentation you must create a folder for the temporary static-files, inside the plugin installation folder.

So, from FTP or your hosting file manager create the static-files folder inside the plugin directory already installed so that the path looks like this:

/yourdomain/public_html/wp-content/plugins/simply-static/static-files/Code language: JavaScript (javascript)
ftp hosting creating the folder for the plugin

Run the Simply Static diagnostic

Once the above is done perform a diagnostic of the plugin requirements from its settings page, under Simply StaticDiagnostics.

simply static diagnostic

Configure Simply Static settings

Now, before you start generating the static files, it is essential to configure the plugin settings, which you will have in Simply StaticSettings.

In the first screen, general settings, you must define where and how the static files will be saved.

simply static general settings
  • Destination URL: Here you must decide between one of the available options. This setting will determine where the URLs of the static website will lead to, so be aware of the final destination of the static files.
    • Absolute URL – If you are going to create the static site in the same domain where WordPress is installed.
    • Relative URL – If the static website will be created in a folder.
    • Save for offline use – If you will only create the static copy to display the website on your local computer.
  • Delivery method: Here you can choose between ZIP file, if you are going to download the files and then upload them to wherever you want (domain, subdomain, etc.) or local directory, if you want to store your static website in a folder on your server.
  • Local directory: If you chose this option in the previous setting here you must indicate the path where they will be saved.

Then you can configure what to include or exclude in the static copy, being able to even add URLs that were not linked from your WordPress, as well as exclude links to WordPress own URLs, such as the access URL and others.

simply static inclusions/exclusions settings

In the next screen, the advanced settings screen, you can specify the temporary files folder, or even for large sites enable WP-Cron to schedule the generation of static files.

simply static advanced settings

The next screen is just to reset the plugin settings to their default values, in case you get confused.

Generate static files for your website

If you have gone through all of the above and the Simply Static plugin diagnostics show everything as correct, we can now generate the static version of the website.

Just go to the Simply StaticGenerate toption and click on the “Generate static files” button.

simply static generate static files

Depending on the size of your website it will take more or less time, and at the end it will show you a complete log of the result.

simply static generated static files

Make the web static

Once you have generated the files, it will depend on the chosen delivery method and destination to finish having your static web.

So when we created the destination of our static website we had to put it in an already existing folder of our website(or create a new one in our FTP under public_html).

So if you wanted to keep only the static website you would have to delete all the other folders(the WordPress PHP files) that aren’t the one we chose for our static destination.

The same if the destination was a ZIP file, but in this case with the previous step of decompressing the file, otherwise it is the same.

Important checks before and after converting WordPress to a static website

Always, to convert your WordPress website to a static website I recommend you to check the following:

  • If you are going to replace the WordPress website with its static version, first make a full backup (better from the hosting) in case you regret it at some point.
  • Once the static website is uploaded, check that all the links work perfectly.
  • The forms, if you did not exclude them, will still be there but they will not work, so you better delete any reference/link to them.
  • In the static web files you will see that some typical WordPress folders still remain, such as wp-content and wp-includes. Do not delete them, it is not a mistake, the static web needs them because there will still be CSS files and images that it will use to work.
  • If something doesn’t work as expected, check the plugin settings configuration. Almost always failures are due to an incorrect choice of destination URLs and local directory. Don’t worry, you can regenerate the static files as many times as you want, just delete the previous ones first.

It is surprisingly easy to convert WordPress to a static website. My last tip is to try it first with a test domain, but you’ll see that the process is surprisingly simple and effective.

How useful was this post?

Click on a smiley to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

About The Author

Leave a Comment

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

Scroll to Top
Skip to content