August 05, 2018
WordPress websites are dynamic, which means in order to display the content on a website, it needs to be queried from the database as the page loads. This call to the database adds on precious milliseconds to the time it takes the page to load. By flattening your site (much like flattening a Photoshop file), and making it static, your site would already have all the HTML, images, CSS, Javascript ready much faster than a dynamic site.
The most popular static site generator plugins for WordPress are Simply Static and WP Static HTML Output. Before using them, it’s important to understand their advantages and disadvantages:
The setup instructions for using Simply Static assume you have a WordPress installation at www.example.com, and that’s where you’d like to have your static site. First you’d need to move your WordPress installation to a subdomain, such as wordpress.example.com. Once that is complete, you’d set up www.example.com in the plugin settings to receive your static files.
If www.example.com is on the same server as your WordPress installation, you can have Simply Static copy the static files to the directory that www.example.com is serving files from. If www.example.com is on a different server, you can download a zip of your static files and then upload them to www.example.com.
Not everyone will feel comfortable with these migration instructions, and it’s hard to track if anything breaks along the way (for example, image files can get left behind or CSS might not render properly, and that’s hard to troubleshoot).
A CDN (Content Delivery Network) is a way to serve your site’s static assets (images, CSS, Javascript) from a location closest to your user so that the site loads faster.
Static generator plugins don’t use a CDN to serve your content, so you’d need to procure and configure a separate solution for your site.
Static site generator plugins like Simply Static use meta-tag redirects on the static site output instead of real 301 and 302 redirects.
This is because an .htaccess file isn’t created for the static site, so the only way to handle redirects is in the meta tags.
Here’s a look at the HTML on a page that’s set up to redirect:
This is not good for search engine optimization and could cause some serious issues SEO-wise.
Your site may need to make Ajax requests to the database in order to display certain elements without reloading a page.
These Ajax requests won’t work if you use a static generator plugin because that is dynamic functionality that needs to communicate with the database, and the static site doesn’t have a database.
Contact forms created with WordPress plugins need special support and won’t work with a static generator plugin because they are a dynamic function that must communicate with the site’s database – and as mentioned above, static sites don’t have a database.
You could use paid third party contact form services, but you may have difficulty customizing the design to match your site.
Native WordPress search won’t work with a static generator plugin because it is dynamic functionality which must query the database to produce the search results. You could use a paid third party tool but they can get expensive quickly, depending on how big your site is. They can also be complicated to implement.
Since native WordPress comments require dynamic functionality, they won’t work with a static generator plugin. You’d need to use a third-party solution like Disqus or Facebook comments. Disqus is actually really easy to integrate, so this is not a major issue, although some users may prefer to not depend on a third-party service for managing comments.
Static site generators republish the whole site every time you make a change, rather than just deploying particular pages that were added or edited. So if you have a bigger site, and just want to change one word on one page, you have to wait for the whole site to be re-published to see that change. That can take quite a while.
In a static site generating configuration, your original WordPress website is the weakest link from a security point of view. And in this scenario, it is still exposed to all the bots and other malicious attackers scouring the web for WordPress websites with known vulnerabilities. You still have to deal with brute force attack attempts, keeping your plugins and software updated at all times, and more.
If a visitor gets to a page on the static generated site that has been deleted or they typed in the url wrong, they could end up at a 404 Page Not Found error that looks like this:
The issue with any plugin that is not using the Freemium model (where the most basic product is free but additional functionality requires upgrading to a paid version) is that support for the plugin can get spotty. And hey, it’s free, so there’s not a whole lot that you can do if you don’t get support responses quickly or at all.
Static site generator plugins are a logical progression for the WordPress ecosystem, since they offer an additional layer of speed and stability to your site. However, although they are free, they have many limitations and require additional resources to get your site up to speed (pardon the pun), secured, and functioning properly.
Frustrated by these limitations, Strattic was created to go beyond generating a static WordPress site and comes with built-in solutions for dynamic functionality such as contact forms and full site search, an integrated CDN, bulletproof security, serverless hosting, and more. You can see a full comparison chart between Strattic and static site generator plugins here.
Rebecca Markowitz
Head of Customer Experience at Strattic
Love onboarding companies to Strattic so WordPress sites can be fast, secure, and reliable in one click. Instead of downtime or crashing when you drive traffic to your site, it actually gets faster (crazy, but true!). This is the true magic of Strattic and static output.