https://wordpress.org/themes/garden-landscaping/, and created the default site on my Wordpress server.
We’ve seen slower Wordpress websites before - 56 is surprising not bad for a dynamic Wordpress website! The largest issues are unoptimized images, excessive Javascript size and execution (especially on mobile, where almost all of this Javascript is unused), and layout shifts due to content loading in a clunky way.
The site is usable, but it could be vastly improved. For an optimized static site, 56 is extremely bad. Let’s use Simply Static to export the website, host it on Netlify, and perform another speed test:
Better! Script execution time is vastly decreased, as well as time to First Contentful Paint (when content is first visible) and Total Blocking Time (when a file is loading/executing and other files have to wait to load, this adds to blocking time). This is because the server doesn’t need to generate content. It simply needs to send the html files and other assets to the client.
But it could still be improved. We’ll talk about image optimization later.
There are several plugins that will handle the export for you, so you don’t have to do it manually!
Simply Static works well, and that’s the plugin we recommend. It’s easy to setup and use, with minimal configuration. If you face issues with Simply Static, an alternative we recommend is https://www.httrack.com/
Step 1: Install and Activate the Simply Static Plugin.
To get started, you’ll need to install and activate the Simply Static plugin. You can do this by going to the Plugins section of your Wordpress dashboard, clicking on “Add New”, and searching for “Simply Static”. Once you’ve found it, click “Install Now” and then “Activate”.
Step 2: Configure Simply Static.
After activating Simply Static, you’ll need to configure it to export your Wordpress site to a static site. Go to the Simply Static settings page, which can be found under “Tools” in the Wordpress dashboard. Here, you’ll see a number of settings that you can customize, such as the URL of your Wordpress site and the location where the static files will be exported.
Step 3: Generate the Static Site.
Once you’ve configured Simply Static, you can generate your static site by clicking on the “Generate” button. This will begin the process of exporting your Wordpress site to static files. Depending on the size of your site, this process could take several minutes.
Step 4: Download the Static Site Files.
After the generation process is complete, you’ll be able to download the static site files. Simply Static will create a zip file containing all of the static files, which you can then download to your computer.
There are other configuration options as well, such as exporting all files to a chosen folder rather than downloading a zip.
To ensure it exported properly, open index.html within your exported files.
Step 5: Add to Netlify (or other static site host).
Create a new Netlify site: Sign up for Netlify if you haven’t already, and create a new site. Choose a name for your site, and select your preferred deployment method (Git or drag-and-drop).
Connect your Git repository: If you’re using Git, connect your repository to Netlify by providing access to your repository. It’ll ask you to configure your build settings to tell Netlify how to build your site. For static Wordpress sites, leave this blank.
Set up custom domains: If you’re using a custom domain, set up your DNS records to point to Netlify. You can find detailed instructions in the Netlify documentation.
Deploy your site: Once everything is set up, you’re ready to deploy your site to Netlify. Simply push your changes to your Git repository, and Netlify will automatically build and deploy your site.
The largest issue now is unoptimized images, so let’s optimize some of the problematic images. In your static Wordpress folder, you’ll have to seek out the images folder. This can vary depending on your theme, and there may be more than one folder. If you can’t find it, try searching for an image file name in the file explorer.
We highly recommend Microsoft PowerToys for Windows 10+ users as an image resizer. The actual size of your images should be very close to their actual size on the webpage. For example, if you download a 6000x3000 stock image, it will have a large filesize. If you’re only displaying it 800x400 on your website, then you can safely reduce its size to drastically reduce filesize. Powertoys provides a very easy way to do this, completely for free.
Consider running your images through an image compressor as well, such as Compress JPEG for jpg/jpeg images.
You may or may not want to do this with all of your images. We stick to the most problematic ones. If you modify images, ensure that the file names and file type stay the exact same, or your static Wordpress website will not know where to find the images!
Hooray, Performance is in the green! I only optimized 5 of the largest stock images to achieve these results. It takes only a few minutes, and it brings enormous benefit.
There are a few limitations worth mentioning when exporting a Wordpress site to static.
Simply Static requires a specific version of PHP, as stated in the plugin description. There is a minimum and maximum version required for it to work properly. If it’s not working, check your PHP version
Exporting a Wordpress site to static will immediately bring performance improvements, but for other metrics, you are generally limited to Wordpress plugins. Some can be very helpful, but in the end, it may be difficult to get close to 100 on any metric.
The easiest way is to host your website on a cheap Wordpress server somewhere, make the changes, then export to static. But, you’ll lose any post-export changes like image optimization as it will be overwritten.
If you are going to change the content frequently, we wouldn’t recommend this method.
This will largely depend on your Wordpress theme, but from our experience, you cannot use Netlify’s inline-critical-css or image-optim plugins, as the plugins will crash. This is unfortunate, because it could save you a lot of manual work.
We won’t ask your reasons for wanting to build a site with Wordpress and export it as a static site, but to be honest, this is far from an ideal solution. Site maintenance is not easy, and the code is still clunky. Wordpress is notorious for adding excessive code - this is not a problem if you’ve hand-coded your website, since you have complete control over the code.
Although we don’t generally recommend exporting a Wordpress website to static, it is indeed possible. There are a few reasons why you may want to do this, such as adding a Wordpress site to your portfolio and not needing to pay server hosting fees for it.
Make sure you know why you want to do this - there might be an easier way to do what you want to do!
We highly recommend SSGs like Next.js and Hugo for website front-ends that don’t change often. Next.js is ahead of it’s game, and is suitable for both static and dynamic sites.
For your backend, you can also use Wordpress as a Headless CMS, and connect any front-end you wish. In this case, headless simply means that the CMS (backend) is separate from the front-end. On it’s own, all of Wordpress is tightly coupled so the Wordpress Headless CMS may be suitable for you if you like the Wordpress admin interface, but don’t want the clunkiness that comes with it.