WordPress CMS provides a top-notch experience to the users regardless of the device or screen. The CMS has gained much popularity with the constant release of plugins & themes. Moreover, it has now become the leading CMS worldwide.
The CMS has become popular due to SEO-friendliness, a massive community of developers, interactivities, scalability, and effortless content management. However, if you want more speed than interactivity in your WordPress site, you should opt for a static site. Now the question arises, how to create a static WordPress site?
Simple. You can build a static WordPress site with the help of a static site generator.
In this blog, we will explain the reasons to use a static WordPress site generator and how to use a WordPress static site generator.
So, let’s get started.
Should You Use a WordPress Static Site Generator?
Before we start discussing the topic in detail, it’s important to note that creating a static WordPress site is not the best solution for all websites.
If you’re still confused by what this term means, a static site implies that you decouple WordPress from the front-end of your site by using WordPress to generate a set of static HTML files. You can then take these HTML files and host them anywhere, even on a completely separate host from your WordPress install.
You can still use the WordPress dashboard to design your site and create content. But those changes won’t appear to visitors right away. Instead, you’ll need to generate a new set of static HTML files each time you want to deploy your changes.
However, there’s a reason why WordPress isn’t static by default – being able to use all of WordPress’s dynamic features is a big part of what makes WordPress so awesome.
By making your site static, you’ll lose a lot of WordPress’s flexibility. It will also be harder to work with core site features like contact forms, comments, and site search (though there are ways to get it done).
Article Continues Below
However, the benefit of this is that your site will load lighting fast, use very little server power, and be virtually impenetrable to malicious actors.
Overall, using a WordPress static site generator can be a good option if:
- Your site doesn’t change a lot.
- You don’t rely on dynamic content (for example, if you want to use WooCommerce, you can’t create a static site).
Some examples of the types of sites where this might make sense could be:
- Simple brochure website for a business.
- Basic portfolio or online CV.
- Simple blog (though most blogs would be better suited to vanilla WordPress).
How to Use a WordPress Static Site Generator?
Now, we will explain how to use a WordPress static site generator to convert your WordPress install to static HTML.
For this tutorial, we’ll use the free WP2Static plugin. The free version of the plugin would work for most uses, but the developer also sells some premium add-ons for just $25. For example, you can find an add-on to help you set up a site search powered by Algolia.
The basic process goes like this:
- Create your source WordPress install. You can create it anywhere, even on a local development site (which is what we will follow for this tutorial)
- Choose where you want to host your static WordPress site. Here we will explain how to export your site to a Zip archive, but WP2Static can also help you automatically deploy to FTP, Amazon S3/CloudFront, GitHub Pages, and more.
- Use the WP2Static plugin to convert your site to static HTML.
1. Create Your Source WordPress Site
In order to generate a static version of your site, you first need to set everything up with a normal WordPress install. That is, you’ll use your regular WordPress install to:
- Add content – you can even use a page builder plugin such as Elementor or Divi
- Choose and customize your theme
- Configure settings, like time zones
You can host your source WordPress installation online using any WordPress host. Or, for a cheaper solution, you can just use a local development tool. Visitors will never interact with your WordPress install, so it doesn’t matter if it’s publicly accessible or not.
For the most part, you don’t need to overthink this. Just set up your WordPress site as you usually would. For my example site, we set up a primary site using one of the demo sites from the Astra theme (our review).
The only thing to consider is that some plugins/features won’t work when you convert your site to the static version. For example:
- The native WordPress comments section won’t work
- Most contact form plugins won’t work
Basically, if the plugin/feature relies on something “dynamic” and/or accessing your WordPress site’s database, it’s going to stop working when you convert your site to static HTML
If you still want these features on your static site, consider the following workarounds. You can use
Basically, you want to use hosted services that deliver their features via scripts. Because these services don’t need to use the WordPress database, they work fine with static HTML.
You’ll want to set these services up on your WordPress site before you continue.
2. Choose and Configure Your Hosting Destination
Next, you’ll want to choose where you will host the static version of your site. You can use:
- Cloud hosting
- Your favorite hosting service
- GitHub/GitLab/BitBucket Pages
- A CDN (because all you’re delivering is static HTML)
- …anywhere that lets you host and deliver static HTML files
WP2Static includes built-in automatic deployment integrations for:
- GitHub/GitLab/BitBucket Pages
- Amazon S3 and CloudFront
- Rackspace Cloud Files
Basically, this means that you can automatically upload the static version of your site right when you export it from WordPress, which is super convenient. This will also make it easier to update your site in the future.
However, if you want to host somewhere else, WP2Static also lets you export your site to:
- Any FTP server
- A ZIP archive that you can upload anywhere
For this example, here we will explain how to deploy using the ZIP archive method because it’s the most accessible, and you can use it anywhere.
You’ll need to take the files in the ZIP archive and upload them wherever you want to host your site.
3. Set Up WP2Static Plugin and Deploy
Once you’ve set up WordPress and chosen the destination for your static HTML files, you’re ready to let WP2Static work its magic.
Install the free plugin from WordPress.org. Then, go to the new WP2Static tab in your WordPress dashboard.
WP2Static does include some advanced settings, but most sites should be fine with the defaults.
To publish your static WordPress site, ensure you’re in the Deploy static website tab. Then, select your destination from the drop-down at the top. Again, for this example, we’re using the ZIP archive method.
Once you select your destination, you’ll see a list of settings that apply to that specific destination.
For a ZIP archive, you only need to enter the Destination URL for your live website. For example, if you’re hosting your static site at https://staticwebsite.com, enter that in the Destination URL box.
For other deployment methods, you must also enter details to connect to your destination.
Then, click the Start static site export button.
WP2Static will then convert your WordPress site to static HTML. How long this takes will depend on the size of your site.
Once the process finishes, you should see a success message. For the ZIP archive method, you’ll also see a button to Download ZIP:
If you look inside that ZIP file, you’ll see the static version of your site:
To make your static site live, you only need to upload those files to your server using something like FTP or cPanel File Manager. Learn how to use FTP.
Voila! You just created a static WordPress website.
4. Re-Deploy When You Update Your Site
Because your WordPress install is decoupled from the static HTML files that your visitors interact with, your site will not immediately update when you make changes to the WordPress version.
Instead, you’ll need to repeat the actions from Step 3 to re-deploy your site whenever you want to push your changes live.
If needing to deploy files each time manually is too time-consuming, you might want to use one of the automatic deployment methods that WP2Static supports.
Overwhelmed with the Above Method? Use Static WordPress Hosting
If you find the manual method above to be a little too complicated, you can also find dedicated hosting services that handle converting your site to static HTML and hosting it. As a bonus, these will also often have integrations so that you can still use specific plugins.
Three of the best options that you can utilize to convert any of the existing sites into a static website with WordPress:
We cover these services in more depth in our post on static WordPress hosting.
Use a WordPress Static Site Generator Today!
Creating a static WordPress site is not the best option for all sites. But there are a lot of WordPress sites that could benefit from the performance and security improvements from going static.
If your site fits the bill, you can use a free WordPress static site generator plugin like WP2Static to easily convert WordPress into static HTML files.
Then, you can host those files pretty much anywhere.
Frequently Asked Questions
- Should I use WordPress to create a static website?
Yes, it would be best if you used WordPress to create a static website. Here are some of the main reasons behind it:
- Quick Load Times: The time required to fetch information in any of the complex websites causes many issues such as delays, frustration, and more. With a static site, all the files would be pre-loaded. Hence, it results in quick load times.
- Improved Security: WordPress, despite being a leading CMS, there is one or another news related to attacks. With a static website, there wouldn’t be server-side functionality. Due to this, it results in higher security.
- Low maintenance: When we talk about WordPress sites, they consist of different plugins for optimization, such as the firewall, security, backup, and more. In the case of a static website, you don’t have to worry about any of the plugins.
- Do I need coding knowledge to use a static site generator with WordPress?
There is no coding knowledge requirement as the static site generators come with pre-built themes and templates. However, having coding knowledge would be highly beneficial to modify various things on the website efficiently.
- Can I use WordPress plugins and themes with a static site generator?
No, you can’t use WordPress plugins and themes with a static site generator. The reason is that a static site doesn’t have a server, and most of the plugins & themes possess dynamic functionality and depend heavily on the database and other things that aren’t linked directly with the static site generator. But you have complete control to modify themes or plugins in a static site as needed.
Do you have any questions about how to create a static WordPress site? Ask us in the comments!