You can prevent a “hard” flush, which updates .htaccess (Apache) or web.config (IIS), with the flush_rewrite_rules_hard
filter.
We can also use the __return_false
helper function here.
add_filter( 'flush_rewrite_rules_hard', '__return_false' );
This code can be placed in your own plugin or a theme’s functions.php
file.
Related Posts:
- removing index.php IIS 7.5 webconfig
- .htaccess file missing from WordPress install directory
- Permalinks not working
- All files in public_html, Cannot launch WordPress site via wp-admin
- Does WordPress Change the .htaccess File When Updating?
- Move WordPress to subdirectory, keep ALL URLs
- 301 Redirects for Changed Permalink Structure & Category Base
- Permalinks to Custom does not work (out of box)
- WordPress permalinks Yahoo hosting(no .htaccess allowed)
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- Passing variables through permalink structure
- How to map permalinks with accented letters to sanitized slugs?
- Remove subfolders from URL
- htaccess or redirect to cloak portion of a link?
- WordPress overrides the GET variables, (page_id) set in HTACCESS
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Changing URL from /%postname%/%post_id to /%category%/%postname%/%post_id%
- Using only %postname%
- removed index.php now all pages 404
- Rewrite rule never matching
- wordpress permalinks tweeks
- Getting a 500 internal server error ONLY on wp-admin/options-permalink.php
- Custom url for a single page
- .htaccess – Redirect duplicated post ended in ‘-number/’ to the same url without the -number/
- WordPress redirection problem after moving to a new server?
- After moving from subdirectory to home, home page does not display
- Specific URL Rewriting with parameters in wordpress
- WP Site in subdirectory Joomla! Site – Permalinks not working
- Rewrite my default post URL
- Permalinks: Page Not Found
- How to protect htaccess so it can’t be overwritten?
- Changes to .htaccess not updating the file (old rules still take effect)
- AWS WordPress Install – pages/posts 404 on restart until updating permalinks
- Need Help Correct Regular Expression Redirect Code
- Permalinks settings page blank
- 301 Redirects Result in 404 for WordPress Search Query Strings
- After updating to 4.8 permalinks will not work (all 404)
- Permalinks not working with Vagrant
- Only default permalink is working mod_rewrite enabled
- How to redirect to correct pages after permalink structure change
- Why does the ‘Month and Name’ Permalink Format not Work on my new WordPress Site (running on IIS7)?
- How do I add /blog/ as a prefix to permalink structure for posts, categories & tags?
- Only plain permalinks working
- WordPress Sub domain
- How to change old permalink?
- Redirect Uploads Folder to Query Vars in WordPress
- WordPress url ingore permalinks setting [closed]
- URL rewriting: removing the site’s basename for a specific category
- Redirecting all posts after changing URL structure with htaccess
- Redirect all posts permalinks from “.html” to “/”
- flush_rewrite_rules breaks permalinks
- WordPress 4.4 old permalink redirect
- Accessing Subdirectories in WordPress Install
- Empty permalinks settings in .htaccess
- How to rewrite a URL to another rewritten URL without changing the address?
- How to use different domains for different blogs hosted in the same host in subdomains with .htaccess
- WordPress 3.1 .htaccess contents keep dissappearing?
- Custom permalinks in WordPress
- Permalink opens attachment instead of page
- What causes /pages/ to appear in URI, and how to remove it?
- url rewrite .htaccess extension to permalink
- Changing WordPress routing to load the same page for different URLs
- Test site pages go to main site
- Strange behavior: random HTTP error 500 fixed by visiting Permalinks settings page (htaccess issue with language code)
- Permalinks on Windows IIS not working and web.config breaks site – does wordpress not support windows server now, if so how?
- how to prefer static page if it exists over wordpress page
- change WordPress permalinks and redirect new urls 301
- Why will Pretty URLs not Work?
- Page redirect to 404 when set Permalink = “Post Name”
- How Can I Use a Custom AccessFileName?
- WordPress Page Not Found if Permalink Settings is Postname
- xammp server permalink by postname not working
- Conditional Permalink based on category?
- Custom permalink structure only saves with index.php inserted
- Problems with permalinks (.htaccess not working)
- the_permalink() not working
- Change author permalink using htaccess?
- Moving blog and maintaining current permalinks
- Got 404 error when changed siteurl via DB in WordPress
- Cannot publish posts or pages when I change permalink structure
- Very strange behaviour related to htaccess and custom posts and custom posts substrings (BUG?)
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- My permalinks for all pages and posts now include old page titles as parents/categories
- Page permalink redirects to home page
- Remove index.php from url in permalinks over IIS server (web.config)
- Remove/hide a specify category-name from the url
- LetsEncrypt WordPress on the Raspberry Pi – Nice url’s give 404 with https, http works
- Removing or hiding slug/permalink from htaccess
- Pretty permalinks (again)
- When using number in url it is redircting to same page but when using character it redirects to 404
- Once redirected by Rewrite rules, how can WordPress know the page?
- Remove index.php from WP 8.0 install migrated to IIS from Apache (still detecting Apache server)?
- How do you put your own rules into .htaccess?
- Problem when i configure permalink
- 404 posts error after 301 redirection of changed category / tag base
- Permalinks is not working in my wordpress setup
- Use .htaccess to redirect homepage to its permalink
- Stymied by 500.5 error for WordPress on IIS 8 / Windows Server 2012
- 301 Redirect posts to newly added categories
- How to use ‘blogs.dir’ as media upload instead of ‘uploads’ directory in WordPress multisite setup