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]
- SSL redirect loop using WordPress HTTPS Plugin
- How Do I add a redirect rule to WordPress?
- How to change default page slug?
- What is the best way to output plugin result in certain url
- Using rewrite rule to access a view of a plugin from home page
- Detecting $_GET parameters from any page + Cookie
- How to send “Location” header on plugin form submit event?
- Custom rewrite rule
- What’s the _wp_desired_post_slug value for?
- How to add rewrite rules and pagination to retrieve attachments files?
- Rewrite url without flushing the database?
- Custom page slug without creating a WP page
- Best way to hook a custom url?
- Checking that the Rewrite API is available
- how can I link to a PlugIn admin-sub-menu page after processing a formular
- Remove rewrite rules generated by plugin during deactivation
- How does automatic redirection for the redirection plugin work?
- Changed permalink structure. Need help with redirecting old posts
- Why slash is removed after domain?
- Landing Page Redirect Chain | http->https->https www
- Redirection based on location but without affecting search bots
- Plugin appends ugly URL string to index
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- How to fix the woocommerce – adaranth.com redirection issue [closed]
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Rewrite rule not matching
- register_taxonomy and variable rewrite slug
- Remove .htaccess portion upon plugin deactivation?
- How to use login_redirect with a user capability
- Removing Automatic Redirects Without Plugin
- How to customize a title by passing query string?
- WordPress plugin url for form submit
- Page get parameter doesn’t work with is_single() function
- Username Variable in custom links?
- rewriterule not working
- Conditional custom redirect
- Passing value as hidden parameter to next page
- PHP mobile redirect Endless loop
- 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
- 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
- Identify User Language, Redirect to the corresponding page and Save the chosen language as Cookie
- Display value of the GET parameter in a new URL page
- one url for all pages
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- WordPress Admin login redirect to homepage
- plugin: rewrite rules are lost when WP updates
- WordPress drop domain alias
- Broken page redirect
- Identify if the_post hook is being called from the admin post list
- Infinite 301 redirects after definitions in “Redirections” plugin?
- How to regenerate slugs for categories and tag converting non-Latin characters?
- add_external_rule – rules deleted when visiting permalinks page
- Direct URL to a template via plugin
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Rewrite URL to plugin file
- Template redirect inside of plugin not redirecting
- How to programatically create a simple HTML page using the permalink of a WordPress post?
- How to remove post redirects
- Migration from old CMS to WordPress 301 redirection rules?
- How to create custom content on custom page from plugin?
- Redirect url in plugin to somewhere else?
- How do I to override login redirect on specific pages?
- How to get the real address from a url (permalink)
- Please Check this ‘.htaccess’ File
- Page with redirect