WordPress websites are generally hosted as dynamic website but they are converted to static version by caching each page. These cached version of WordPress websites are called as static WordPress.
Static WordPress has several inherit advantages e.g. better speed (up to 25 times), lower maintenance costs, easy scalability and added power of WordPress Content Management System.
What is a Static Website?
The basic building block of a website is an HTML file , which contains the desired content, its structure, links to several images and other pages, and page formatting is carried out using a Custom Style Sheet (CSS) file. These files, representing a classic website development approach, can be shared online as a static website.
Why Static Web Hosting?
Static Web hosting is as simple as placing a folder at a online web server as there is no processing or database query required to fetch and process the data. Static websites has been gaining popularity for the last several years, especially due to the modernization of JAMSTACK.
Historically, these servers were quite simple and data was simply hosted using FTP or sFTP. With the advent of modern web architectures, more sophisticated static hosting solutions have evolved, while bringing the following benefits to the content providers.
- Improved Speed
- Better Security
- Highly Scalable
- Cost Saving
- Fewer Dependencies
How Static WordPress Works?
Static WordPress is the process of generating the static version of (dynamic) WordPress website. This process consists of caching all the web content (HTML, JS, CSS, Images, PDF, and etc) of that WordPress website.
This cached version only works for those content which can be served statically e.g. blog articles, and pages. It will not work with dynamic content e.g. user registration, comments and etc.
Following this, there evolved the need for tools that can convert dynamic website content to static websites for easy and stress-free deployment. Several solutions have evolved in this arena both open source and commercial which are discussed in later section of this post.
What are the SEO Advantages of Static WordPress Website?
All web developers and content creators strive for Search Engine Optimization and better ranking on SERPs. There are some definite advantages of a have a Static Website such as
Page speed is one of the ranking factor and Google like/tend to rank fast websites higher. On average Static websites are 25x faster than their dynamic counterparts, so static websites tend to perform better for SEO.
Security and Malware Attacks
can have negative implications for a website SEO. With static website, you will almost eliminated those attacks as they are not inherently prone to malware attacks and have less security risks.
Pros and Cons of a Static WordPress website?
Creating a static version of a WordPress website bring several advantages. There are also some WordPress features which will not work with static WordPress version. In later section of this tutorial, we will discuss the solutions for those disadvantages/cos of Static WordPress.
Following is a pros and cons list of of some of those features.
- Improved Speed
- Better Security
- Highly Scalable
- Cost Saving
- Fewer Dependencies
- Search Bar
- Contact Forms
- Complex Build Process
How to Manage Dynamic Content on a Static WordPress website?
Based on our years of experience with both (static and dynamic websites), we have prepared a list of points that one needs to consider before converting their WordPress website to a static website. This list should help you in deciding on choosing dynamic or static website for your next WordPress project.
WordPress contact forms are generally created using custom plugins such as Form 7 . These forms do not work out of the box and need special treatment. Some websites do not necessarily need a contact us form so they can ignore it or choose an external form service provider.
If you need a contact us form for your static WordPress website then you can follow the method we mentioned in our post How to Configure WordPress Contact Us Forms on Netlify? This approach uses Netlify forms and will not work with other static hosting service providers.
WordPress comments also do not work with a Statically generated WordPress website. This is mainly due to the static nature of a newly created website.
To integrate comments into your WordPress static website, you can use third-party solutions like Disqus, Utterances, or Facebook comments. Most of these services can be easily integrated to a static website. You can also choose Utterances to avoid dependency on third-party services provided and have more control over the data and privacy of a visitor.
WordPress search for its static version will not work out of the box. If your static WordPress website needs search functionalities then you have only limited options. You can choose to integrate Google Search into your website, or external service providers such as Algolia .
If you are on a budget and need a free solution then you can embed JS-based search functionalities into your website. This functionality can be included with JS libraries e.g. Tipue Search or Lunr.js. You can see our detailed post on how to achieve this.
Statically hosted WordPress sites are generated using custom plugins e.g. wp2static. These static sites do not create .httaccess to establish redirects rules. You need to create those files manually e.g. for Netlify we can create netlify.toml file and include it in the root folder of your website before hosting it on a server.
Most of the static site generation plugins for WordPress will use meta tags for redirects which is a bad choice for Search Engine Optimization (SEO).
404 Page redirects are managed at the hosting level and one should not worry about them. You just need to include a 404.html page on your Website root folder, if you want a custom 404 response.
A customized 404 Page can bring a better and improved user experience and can be easily configured as mentioned in our post on How to configure 404 Error page for WordPress Static Website on Netlify?
Ajax requests also dost not work out of the box with a Statically Generated WordPress Website. However, some hosting service providers offer solutions to this problem through extended functionalities with their paid and free plans.
Netlify functions, AWS Lambda and Cloudflare Workers are some of the solutions to achieve this. A developer should still write code for those functions to make your Ajax calls. All tough using these functions might be free in a basic tier but can eventually increase your production cost.
Static WordPress Site Generators
There are lots of popular static WordPress Site Generators both Commercial and Open Source. The availability and adaptability of these tools depends upon several factors which are discussed in detail.
This is a work-in-progress Open Source software by seowings.org and will be available shortly. This software converts any WordPress website to a Static Website and then uploads it to an online git service e.g. Github, Gitlab, or Bitbucket.
Probably one of the most popular solutions available in the market with a versatile plugin ecosystem. This tool can be installed within WordPress and can be fine-tuned for individual needs.
This plugin is not actively maintained and was recently dropped from WordPress plugin repositories. In our tests, we also notice several bugs e.g. Pagination, Search Bar and etc.
This plugin only works when installed inside WordPress which means one needs to have a working installation of WordPress either locally or remote. We have prepared a compiled version of this tool for our community which you can download directly from our download section.
Recently, simply static has started getting huge popularity. This is mainly attributed to its free and easy availability in the WordPress plugin ecosystem. In our tests, we noticed that this plugin is much cleaner than wp2static and is also being actively maintained. This plugin also requires an active installation of WordPress.
The pro version of this tool provided end to end WordPress solution i.e. all dynamic components of WordPress can easily be configured with the pro version of this plugin.
HTTrack is one of the oldest ones in this niche and is actively used. This works independently of a dynamic content management system and hence works for any.
This software can be installed on a local computer and then be used to download a static version of the website. It merely takes the HTML snapshot of the website and all links associated with that main domain. This tool can be configured or optimized as per the individual needs of a given project. This works perfectly fine for converting a dynamic WordPress website to a Static WordPress website.
Wget is another open-source project which can be used to take a complete snapshot of a website. This tool doesn’t require an active installation of WordPress and will work for any content management system as well as a simple HTML static site.
In Linux/Unix user community this tool is quite popular and commonly used. This is a command-line tool and it is used to modify as per individual needs.
Deploying a WordPress website as a static website could be daunting, especially if you are doing it for the first time. You can do it manually by yourself or use a third-party service provider which fully automates this work for you.
On seowings.org website, we provide tips and tricks to make your journey to static WordPress hosting a smooth ride. We recommend deploying your static website on Netlify although there are other great options available .