Nginx Helper


  1. Removes index.php from permalinks when using WordPress with nginx.
  2. Adds support for purging redis-cache when used as full-page cache created using nginx-srcache-module
  3. Adds support for nginx fastcgi_cache_purge & proxy_cache_purge directive from module. Provides settings so you can customize purging rules.
  4. Adds support for nginx map{..} on a WordPress-multisite network installation. Using it, Nginx can serve PHP file uploads even if PHP/MySQL crashes. Please check the tutorial list below for related Nginx configurations.


You will need to follow one or more tutorials below to get desired functionality:


  • Nginx plugin settings
  • Remaining settings


Automatic Installation

  1. Log in to your WordPress admin panel, navigate to the Plugins menu and click Add New.
  2. In the search field type “Nginx Helper” and click Search Plugins. From the search results, pick Nginx Helper and click Install Now. WordPress will ask you to confirm to complete the installation.

Manual Installation

  1. Extract the zip file.
  2. Upload them to /wp-content/plugins/ directory on your WordPress installation.
  3. Then activate the Plugin from Plugins page.

For proper configuration, check out our tutorial list in the Description tab.

அடிக்கடி கேட்கப்படும் கேள்விகள்

Important – Please refer to for up-to-date FAQs.

FAQ – Installation/Comptability

Q. Will this work out of the box?

No. You need to make some changes at the Nginx end. Please check our tutorial list.

FAQ – Nginx Fastcgi Cache Purge

Q. There’s a ‘purge all’ button? Does it purge the whole site?

Yes, it does. It physically empties the cache directory. It is set by default to /var/run/nginx-cache/.

If your cache directory is different, you can override this in your wp-config.php by adding

Replace the path with your own.

Q. Does it work for custom posts and taxonomies?

Yes. It handles all post-types the same way.

Q. How do I know my Nginx config is correct for fastcgi purging?

Manually purging any page from the cache, by following instructions in the previous answer.

Version 1.3.4 onwards, Nginx Helper adds a comment at the end of the HTML source (‘view source’ in your favourite browser):
<!–Cached using Nginx-Helper on 2012-10-08 07:01:45. It took 42 queries executed in 0.280 seconds.–>. This shows the time when the page was last cached. This date/time will be reset whenever this page is purged and refreshed in the cache. Just check this comment before and after a manual purge.

As long as you don’t purge the page (or make changes that purge it from the cache), the timestamp will remain as is, even if you keep refreshing the page. This means the page was served from the cache and it’s working!

The rest shows you the database queries and time saved on loading this page. (This would have been the additional resource load, if you weren’t using fast-cgi-cache.)

Q. I need to flush a cached page immediately! How do I do that?

Nginx helper plugin handles usual scenarios, when a page in the cache will need purging. For example, when a post is edited or a comment is approved on a post.

To purge a page immediately, follow these instructions:

  • Let’s say we have a page at the following domain:
  • Between the domain name and the rest of the URL, insert ‘/purge/’.
  • So, in the above example, the purge URL will be
  • Just open this in a browser and the page will be purged instantly.
  • Needless to say, this won’t work, if you have a page or taxonomy called ‘purge’.

FAQ – Nginx Redis Cache

Q. Can I override the redis hostname, port and prefix?

Yes, you can force override the redis hostname, port or prefix by defining constant in wp-config.php. For example:



define(‘RT_WP_NGINX_HELPER_REDIS_PORT’, ‘6000’);

define(‘RT_WP_NGINX_HELPER_REDIS_PREFIX’, ‘page-cache:’);

FAQ – Nginx Map

Q. My multisite already uses WPMU_ACCEL_REDIRECT. Do I still need Nginx Map?

Definitely. WPMU_ACCEL_REDIRECT reduces the load on PHP, but it still ask WordPress i.e. PHP/MySQL to do some work for static files e.g. images in your post. Nginx map lets nginx handle files on its own bypassing wordpress which gives you much better performance without using a CDN.

Q. I am using X plugin. Will it work on Nginx?

Most likely yes. A wordpress plugin, if not using explicitly any Apache-only mod, should work on Nginx. Some plugin may need some extra work.

Still need help!

Please post your problem in our free support forum.


செப்டம்பர் 14, 2022
Simple setup and everything works as it should! Thanks
ஜூலை 29, 2022
It doesn’t work at all. It provides outdated content link to setup the cache module but that is also useless. Do not waste your time installing this plugin.
மே 25, 2022
Clears cache when updating pages & posts as expected. Also great that it has a logging functionality, which allowed me to debug some problems.
மே 3, 2022
Nice plugin to manage your cache. The setup is quite simple! Just follow the instructions and you will be fine
ஆகஸ்ட் 31, 2021 2 replies
Had high hopes but to be able to use this plugin to best potential you need to add a repository, according to the relevant guide which seems to date back 9 years. Errors:- E: The repository ‘ focal Release’ does not have a Release file. N: Updating from such a repository can’t be done securely, and is therefore disabled by default. So what’s the point? I may be missing something (such as a guide that works? Am using your recommendation: so sort that out, let me know, and I’ll gladly update this review. Meantime, damn, that was a few hours wasted.
Read all 31 reviews



  • Add the capability to enable/disable purging of feeds. #281 – by Amaan Khan
  • Fix undefined port error when Redis port is set to empty string. #333 – by Amaan Khan


  • Introduces the capability to specify the NGINX_HELPER_LOG constant, allowing users to activate the logging feature. #318 – by Vishal Kakadiya
  • Existing users employing the nginx-helper plugin with logging enabled will experience no disruptions. However, if logging is disabled, users must define the NGINX_HELPER_LOG constant to re-enable the logging feature.



  • Add action rt_nginx_helper_after_purge_all to fire after the entire cache has been purged whatever caching type is used. #232 – by Julien-prrs
  • Fix issue where settings not saved because the button’s value localized (for any language). #236 – by umeshnevase
  • Fix issue where “Custom Purge URL” option displays previous value. #240, #241 – by KirillGritcenko
  • Tested with WordPress 5.4




  • Add wildcard cache key deletion for device type cache purge. #203 – by pradeep910
  • Add filter rt_nginx_helper_purge_url to filter the URL to be purged. #182 – by todeveni
  • Add filter rt_nginx_helper_purge_cached_file to filter the cached file name. #182 – by todeveni
  • Add filter rt_nginx_helper_remote_purge_url to filter remote URL to be purged. #182 – by todeveni
  • Add action rt_nginx_helper_after_fastcgi_purge_all to fire after the FastCGI cache has been purged. #182 – by todeveni
  • Add action rt_nginx_helper_after_redis_purge_all to fire after the Redis cache has been purged. #182 – by todeveni
  • Add action rt_nginx_helper_purged_file to fire an action after deleting file from cache. #182 – by todeveni
  • Add action rt_nginx_helper_before_remote_purge_url to fire an action before purging remote URL. #182 – by todeveni
  • Add action rt_nginx_helper_after_remote_purge_url to fire an action after remote purge request. #182 – by todeveni
  • Fix issue with post purge on new comments. #175 – by jinschoi
  • Fix Nginx Timestamp being added to invalid content type. #200 – by thrijith
  • Handle filesize exception while truncating nginx.log file. #206 – by peterjanes



  • Fix undefined error when we install the plugin for the first time and if Redis is not available. #162 – by Joel-James
  • Remove extra spacing for nginx map section. #169 – by ShashwatMittal
  • Purge Cache menu in front-end admibar now purge current page. #173 – by imranhsayed
  • Fix issue where cache is not cleared when page is swiched from publish to draft. #174 – by imranhsayed
  • Fix an issue where custom purge url option does not show newlines when using multiple urls. #184 – by mist-webit


  • Fix settings url for multisite: use network_admin_url to get network correct settings url. #163 – by Joel-James
  • Fix php error with arbitrary statement in empty – Prior to PHP 5.5. #165 – by PatelUtkarsh


  • Fix typo causing failure to purge on trashed comment. #159 – by jinschoi
  • Refactor Plugin structure and remove unused code. Initial code by chandrapatel, #153 – by jinschoi,
  • Run phpcs and fix warning. #158
  • Make compatible with EasyEngine v4.


  • Allow override Redis host/port/prefix by defining constant in wp-config.php #152 – by vincent-lu


  • Fixed issue where permalinks without trailing slash does not purging #124 – by Patrick
  • Check whether role exist or not before removing capability. #134 – by 1gor


  • Fixed issue where Nginx cache folders deleted on purge. #123 – by johan-chassaing
  • Fixed Redis purge all feature for installation where WordPress lives in a separate folder. #130 – by pySilver



  • Fixed homepage cache cleared when WPML plugin used #116 – by Niwreg
  • Fixed Purge Cache clears the whole Redis cache #113 – by HansVanEijsden
  • One log file for all site in WPMU.
  • Single site Redis cache purge when click on Purge Cache button in WPMU #122 – by Lars Støttrup Nielsen
  • Fixed notices and warnings.


  • Remove timestamp if cron or wp-cli #114 – by samedwards
  • Fixed notices and warnings.


  • Fixed cache purging on post publish.
  • Error fixed when redis server not installed.


Added custom purge URL option.


  • Added redis server connection timeout.
  • Added RedisException handling.


  • Added PhpRedis API support.
  • Added redis-lua script support to purge complete cache very fast.
  • Added composer.json support
  • Fixed cache purging link in admin bar.
  • Updated the initial settings to include the ‘purge_method’ #99 – by


Fix purging for Redis cache and FastCGI cache


Fix purging for custom post types


Added Redis cache purge support.


Fixed PHP notice for an undefined index when “Enable Logging” is not set.


Updated readme and changelog


Fix url escaping #82 – by


  • Security bug fix


  • Default setting fix and wp-cli example correction – by bcole808


  • Added option to purge cache without nginx purge module – by bcole808


  • Added action rt_nginx_helper_purge_all to purge cache from other plugins – by gungeekatx


  • Removed wercker.yml from plugin zip/svn.
  • Updated readme



  • Fix undefined index issue and correct “purge_archive_on_del” key


  • Tested with WordPress 4.0
  • Fix issue #69


  • Tested with wordpress 3.9.1
  • Fix confilct with Mailchimp’s Social plugin


  • New admin UI
  • Fix missing wp_sanitize_redirect function call


  • Update Backend UI
  • Added Language Support


  • Fixed option name mismatch issue to purge homepage on delete.


  • Disable purge and stamp by default.


  • Suppressed unlink related error-messages which can be safely ignored.
  • Fixed a bug in purge-all option.


  • pjv fixed bug in logging file.


  • Fixes bug in true purge and admin screen.


  • True full cache purge added.
  • Map file location changed to uploads’ directory to fix
  • Log file location also changed to uploads’ directory.


  • pjv changed the way home URL is accessed. Instead of site option, the plugin now uses home_URL() function.


  • telofy added purging of atom and RDF feeds.


  • Removed comments from Admin screens since, it was interfering with media uploads in 3.5 up.


  • Cleaned up code.
  • Added credits for code.
  • Improved attachment purging.


  • Added Faux to Purge all buttons, to avoid misleading users.



  • jk3us added better content-type detection for cache verification comments



  • Fixed typo that interfered with archive purge settings. Thanks to Daan Kortenbach for pointing this out.


  • Improved code for map generation to better conventions since the nesting confused some servers.
  • Added map update process to admin_init for frequent refreshes.


  • Fixed duplicate entries.


  • Another bug fix in the revised code for improved multisite and multidomain mapping.


  • Fixed bug in the revised code for improved multisite and multidomain mapping.


  • Revised code for improved multisite and multidomain mapping.


  • Timestamp now only gets added to content-type text/html
  • Added option to toggle timestamp creation


  • Fixed bug related to nomenclature of comment status that caused purge to fail.


  • Removed extraneous headers.


  • Fixed bug in single post/page/post-type purging code. Thanks to Greg for pointing this out here:


  • Changed the action hook, back to ‘shutdown’ from ‘wp_footer’ to add verification comments.
  • Added a check to prevent adding comments to ajax requests,


  • Changed the action hook, from ‘shutdown’ to ‘wp_footer’ to add verification comments. This was interfering with other plugins.


  • Improved Readme.
  • Improved cache verification comments.


  • Fixed duplicate entries generated for maps (Harmless, but doesn’t look good!)
  • Added timestamp html comments for cache verification, as described here:


  • Fixed map generation for multi domain installs using domain mapping plugin, where blog ids were not displayed.


  • Fixed map generation for multi domain installs with domain mapping plugin.


  • Minor fixes for directory structure and file names.


  • Improved Readme.


  • Fixed map generation error.
  • Fixed purging logic.
  • Fixed UI where purge settings were lost on disabling and re-enabling purge.
  • Minor Ui rearrangement.


  • Improved readme.txt. Added Screenshots.


  • First release