Have you tried delete_option('rewrite_rules');
on deactivate? I came across the following when investigating this problem and it did the trick for me:
Typically you register post types on init. Some time after that, you
get the deactivation action. A responsible plugin would remove its
rewrite rules by flushing. However, it can’t undo the registration, so
the flush doesn’t remove the plugin’s rewrites.The hacky workaround I’ve used is to just delete the rewrite_rules
option on deactivation. They will be generated again when they are
needed, so the only noticeable effect is that the next site view may
take a bit longer.
Have a look at http://core.trac.wordpress.org/ticket/14761#comment:12 for a discussion on this topic.
Related Posts:
- Custom pages with plugin
- Add rewrite rule to permalink structure
- Add Rewrite Rule for custom page
- add_rewrite_rule, plugin activation and plugin deactivation
- Custom rewrite rule is not picked by WordPress
- Does flush_rewrite_rules() remove all rules added by other plugins as well as mine?
- Add_rewrite_rule doesn’t add custom url in plugin
- How can I rewrite a plugin generated URL?
- flush_rewrite_rules() not working on plugin activation
- WordPress custom URL Rewrites redirecting not masking
- How does WP handle multiple matching rewrite rules?
- Custom rewrite rules not working with WPML
- How to Create a Custom Slug for Tags and Categories with a prefix or suffix?
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- Custom url rewriting
- URL rewrite with external JSON query
- WordPress rewrite rules not working
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- How to force load a page in plugin?
- i want to rewrite my custom plugin url
- add_rewrite_rule to load different page, without changing URL in browser
- Hidden permalink different from displayed permalink
- WordPress rewrite rule depend on meta values not ids
- Change custom rewrite rule when permalink is updated/changed
- Custom pages with plugin
- Apache rewrite rules and wordpress problem
- WP Job Manger change jobs url (NOT slug)
- URL Redirect on GoDaddy platform [closed]
- register_taxonomy and variable rewrite slug
- Problem with Author page redirect
- URL rewrite of independent plugin?
- Plugin generated taxonomies’ permalinks with custom placeholders
- Redirect to another page using contact form 7? [closed]
- Remove .htaccess portion upon plugin deactivation?
- How to use login_redirect with a user capability
- Removing Automatic Redirects Without Plugin
- WordPress 4.3 broke meta redirect (with url params plugin)
- Locked out of admin panel after installing HC Custom WP-Admin URL [closed]
- How to customize a title by passing query string?
- WordPress plugin url for form submit
- Creating author Specific page URL
- Mask and Track Outbound Links
- rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked
- How can I redirect some pages to new subdomain? [closed]
- Page get parameter doesn’t work with is_single() function
- Add to array, redirect and display
- Username Variable in custom links?
- rewriterule not working
- How to rewrite URL and get the values?
- Conditional custom redirect
- Making the ‘add to cart’ button redirect to PayPal
- Passing value as hidden parameter to next page
- PHP mobile redirect Endless loop
- How to embed a new string in url?
- rewrite file to wordpress
- wp redirect 301 not working in wordpress page
- Preserve Search engine index while shifting to new Domain
- Janrain/Simple Modal under Redirected Domain
- TranslatePress | secondary language category/sub-category not working correctly “`/%category%/%postname%/“`
- Dynamic URL Rewrite for Custom
- can’t install any wp plugins [duplicate]
- Redirect unloggedin users
- Change language on website and change currency with url query
- corrupted URLs – can’t leave starting page
- login form should redirect to register page for in 1st login next time it should redirected to home page
- Identify User Language, Redirect to the corresponding page and Save the chosen language as Cookie
- www redirects to another directory in wordpress
- remove SLASH on single_post but KEEP on categories and parent pages
- redirect to homepage once action is completed
- Display value of the GET parameter in a new URL page
- Having a problem with rewrite_rules and rewrite_tags – url not rewriting properly and query var missing
- Redirect to a page while maintaining search query parameters without causing an infinite loop
- Rewrite/Change custom taxonomy slug
- Custom Rewrite Rule Removing Query String
- one url for all pages
- Redirect empty search to another page
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- Add custom WordPress admin page with pretty url via code
- How to update all in-site redirect URLs to destination URLs at once
- Remove part from dynamic url and redirect
- How to send new visitor to a splash page for only one time in wordpress?
- WordPress Admin login redirect to homepage
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- Why is my site still showing insecure icon even if I have SSL certificate?
- Reverse count page view and show on other page
- plugin: rewrite rules are lost when WP updates
- How to give .html extension to just one post not all post
- URL Rewrite 404
- WordPress drop domain alias
- catch urls with specific pattern and show specific content for them by plugin
- redirect to a custom page
- .htaccess file doesn’t work, with hundred tries
- Broken page redirect
- I am trying to rewrite urls in WordPress, but its not working
- Identify if the_post hook is being called from the admin post list
- Infinite 301 redirects after definitions in “Redirections” plugin?
- Get custom term link archive with prefix
- How to regenerate slugs for categories and tag converting non-Latin characters?
- Change default url to plugin custom post type
- Rewrite in plugin