WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Rajin Sharwar v2.4

Serve Static

Serve Static is a static HTML page generator WordPress plugin to create and serve static copies of your existing web pages to avoid PHP/DB load.

Serve Static

The facts

Rating
4.4★ from 9
Active installs
100+
Price
Free
Last updated
8 Feb 2025
Added
May 2024
Requires WP
5.0
Tested up to
WP 6.7.7
Requires PHP
7.4
Downloads
6,149

Our analysis

AI-assisted

Serve Static is a WordPress plugin that generates static HTML copies of your webpages for improved performance. By serving these static files, it bypasses the PHP and MySQL processes, which can speed up page loading times. This plugin is suitable for websites with mainly static content, such as blogs, portfolios, and company sites.

The plugin includes features for HTML, CSS, and JavaScript minification, which can further enhance page speed. It also has a cache warming feature to pre-generate static files before they are accessed by visitors. However, it does not support dynamic content caching, meaning any dynamic elements will not be displayed on the frontend.

Best for: Websites with primarily static content looking to improve loading speed.

What it does well

  • Generates static HTML copies of webpages
  • Bypasses PHP and MySQL for faster loading
  • Includes minification features for HTML, CSS, and JS
  • Cache warming feature available
  • Free to use from the WordPress.org directory

Where it falls short

  • Does not support dynamic content caching
  • Requires manual .htaccess modifications for proper functioning

Verdict

Serve Static can be a useful tool for those managing static websites, but it requires some technical setup and does not cater to dynamic content.

From the developer

Rajin Sharwar's own description of Serve Static, lightly tidied.

Serve Static provides a very efficient, simple and fast way of implementing static page caching in WordPress.
It will generate static HTML copies of your webpages which will be then served using your server rewrite rules. This feature will bypass the whole PHP process and render only a simple HTML file without having to interect with the PHP, or MySQL for getting your page’s design or content.

This plugin is really handy and helpful if your webpages are mainly static, like websites of Blogs, portfolios, company portfolios, service, and many more. This plugin doesn’t support any dynamic content caching, that means, all none of your dynamic content will be showing in the frontend, rather, a static version of that content will be showing.

This plugin also comes with home-made HTML, CSS and JS minification features, which you can use to auto-minify the static files. This ensures more lightness of the HTML pages, and more boost to your page speed. Also, you can auto-warm the cache using the Warm feature, which will stimulate a visit on all your pages, to create the static files before they are served to your visitors.

Usage

After activating the plugin, it will try to modify your .htaccess file. If this is not possible for some reason, make sure to enter the rules by yourself. NOTE: without these .htaccess rules, the static files won’t be served or created. Note that, this is only applicable if you are using a Apache/Litespeed server.

# BEGIN Serve Static Cache
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} !(^|;\s*)wordpress_logged_in_.*$ [NC]
RewriteCond %{REQUEST_URI} !^/(elementor|vc_row|fl_builder|fl-theme-builder) [NC]
RewriteCond %{REQUEST_URI} !^/wp-admin/ [NC]
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/serve-static-cache/$1/index.html -f
RewriteRule ^(.*)$ /wp-content/serve-static-cache/$1/index.html [L]
# END Serve Static Cache

If you the website installed on a sub-folder, like such that “https://test.com/domain1”, is your main domain of your WordPress site, you need to use a different .htaccess code. The plugin will automatically do that for you, but incase you need to do it manually, below is the format you need to follow.

# BEGIN Serve Static Cache
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} !(^|;\s*)wordpress_logged_in_.*$ [NC]
RewriteCond %{REQUEST_URI} !^/(elementor|vc_row|fl_builder|fl-theme-builder) [NC]
RewriteCond %{REQUEST_URI} !^/wp-admin/ [NC]
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{QUERY_STRING} ^$ [NC]
RewriteCond "WP_CONTENT_DIR"/serve-static-cache/"sub-folder domain without slashes"/$1/index.html -f
RewriteRule ^(.*)$ /"sub-folder domain without slashes"/wp-content/serve-static-cache/"sub-folder domain without slashes"/$1/index.html [L]
# END Serve Static Cache

The value of the WP_CONTENT_DIR should be something like: “/home/test.com/public_html/staging/wp-content”
The value of the “sub-folder domain without slashes” should be your folder where WordPress is installed. So, if the WordPress is installed in “https://test.com/staging”, you should enter “staging”.

When using a nginx server, make sure to add the following rules:

# BEGIN Serve Static Cache
location / {
    if ($http_cookie !~* "wordpress_logged_in_") {
        set $cache_uri $request_uri;

        if ($request_uri ~* "^/(elementor|vc_row|fl_builder|fl-theme-builder)") {
            set $cache_uri "null cache";
        }

        if ($request_uri ~* "^/wp-admin/") {
            set $cache_uri "null cache";
        }

        if ($request_method = GET) {
            set $cache_uri "null cache";
        }

        if (-f $document_root/wp-content/serve-static-cache$cache_uri/index.html) {
            set $cache_file $document_root/wp-content/serve-static-cache$cache_uri/index.html;
        }

        if ($cache_file) {
            rewrite ^ /wp-content/serve-static-cache$cache_uri/index.html break;
        }
    }
}
# END Serve Static Cache

This plugin creates static HTML versions of your pages/posts, or literally any custom post types, and serves them to your non-logged-in visitors. This is an awesome way to make your website blazing fast, and not even one request is made to PHP to request your pages.

Anytime a Static page/post/any custom post type is updated, the cache of that specific page is automatically cleared, and regenerated. So, you do not have to worry about regenerating the cache eac time after making changes to your content.

This plugin is also well-integrated with frontend post rating plugins as well, so that when any rating is added, the cache gets regenerated automatically. If you are using any rating plugins that are not working with this plugin, kindly let me know in the support forum.

This plugin heavily relies on CRON to process it’s functionalities. So please make sure either your server-level cron or WordPress Cron is running and working. If not, this plugin will show errors in the Admin Notices to help you direct to the problem. If there are still many issues, kindly share in the plugin support thread.

By default, this plugin automatically works with Apache and Litespeed servers, and everywhere .htaccess rules is functional. But to make this plugin work with NGINX, you will be needing to add some rules to your nginx.conf or site.conf file. An appropiate admin notice will be shown to you accordingly, kindly follow those instructions.

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for making sites fast.

WP-Optimize

Get caching and more with this powerful cache plugin. Cache, optimize images, clean your database and minify f...

Free 1M+ installs 4.8★ (2,606)
LiteSpeed Cache

All-in-one unbeatable acceleration & PageSpeed improvement: caching, image/CSS/JS optimization...

Free 7M+ installs 4.8★ (2,764)
EWWW Image Optimizer

Comprehensive image optimization with WebP, AVIF, Lazy Load, and more. Optimize images automatically for Faste...

Free 1M+ installs 4.8★ (1,838)
Under Construction

Easy to use Under Construction Page & Coming Soon Page. Enable Under Construction Mode in seconds & sh...

Free 600k+ installs 4.8★ (1,285)
Smush

Smush

93

Compress and optimize images, enable lazy load, serve WebP & AVIF, and speed up your site with a global im...

Free 1M+ installs 4.8★ (6,051)
Converter for Media

Speed up your website by using our WebP & AVIF Converter. Optimize images and serve WebP and AVIF images i...

Free 500k+ installs 4.9★ (1,097)