Let me say beforehand that when using add_rewrite_rule()
nothing is written to the htaccess file. Rewrite rules are stored in the database and handled by WordPress internally on PHP level.
TL;DR: Rewrite rules do persist after plugin deletion, but probably not the way you’d expect it.
When using add_rewrite_rule
these rules are added in the options table in the database. You then need to flush the rewrite rules via flush_rewrite_rules()
(Visiting Settings > Permalinks and saving does the same) for them to come in effect.
Similarly when you remove your plugin that added the rewrite rules they stay in effect until the next flushing of the rewrite rules. So yes they persist, but they will disappear at some random point later on when the rewrite rules are flushed.
Related Posts:
- Apache rewrite rules and wordpress problem
- Custom pages with plugin
- Add rewrite rule to permalink structure
- add_rewrite_rule, plugin activation and plugin deactivation
- 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
- flush_rewrite_rules() not working on plugin activation
- Redirect to another page using contact form 7? [closed]
- Remove .htaccess portion upon plugin deactivation?
- Custom url rewriting
- WordPress rewrite rules not working
- WordPress rewrite rule depend on meta values not ids
- Custom pages with plugin
- Add Rewrite Rule for custom page
- What is the best way to output plugin result in certain url
- flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
- Custom rewrite rule is not picked by WordPress
- Add .html extension to custom post type taxonomies
- How can I rewrite a plugin generated URL?
- WordPress custom URL Rewrites redirecting not masking
- Write to / remove from default .htaccess file from plugin?
- Best way to hook a custom url?
- Remove rewrite rules generated by plugin during deactivation
- How does WP handle multiple matching rewrite rules?
- How to Create a Custom Plugin Permalink
- Custom rewrite rules not working with WPML
- Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
- 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?
- URL rewrite with external JSON query
- How to rewrite URL and get the values?
- How to embed a new string in url?
- i want to rewrite my custom plugin url
- can’t install any wp plugins [duplicate]
- add_rewrite_rule to load different page, without changing URL in browser
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- Change custom rewrite rule when permalink is updated/changed
- URL Rewrite 404
- Help Code Review – I need to write on .htaccess file from theme’s function.php
- Change default url to plugin custom post type
- How To Rewrite WordPress Pages URL Only?
- WP Job Manger change jobs url (NOT slug)
- Please Check this ‘.htaccess’ File
- How to rewrite URL using .htaccess in WordPress Plugin
- Trying to Find the PHP File/Function that Handles a Specific Form Action URL
- Uninstall, Activate, Deactivate a plugin: typical features & how-to
- Best way to initiate a class in a WP plugin?
- How do you debug plugins?
- How to structure a plugin
- What’s the preferred method of writing AJAX-enabled plugins?
- Add multiple plugin directories
- What are the differences between WPINC and ABSPATH?
- How to add a shortcode button to the TinyMCE editor?
- Where do I put the code snippets I found here or somewhere else on the web?
- What Plugins Demonstrate Great WP Plugin Development? [closed]
- is_plugin_active function doesn’t exist
- Delete WordPress plugin Repository
- How to change a user’s password programatically
- Who are the most trusted plugin developers? [closed]
- How can I find plugins’ slug?
- List all sidebar names?
- What are the common security flaws I need to look for? [closed]
- Get plugin_dir_url() from one level deep within plugin
- Pass PHP variable to javascript
- Where is the best place to use add_filter
- Can a developer adopt a plugin marked as “not updated in over 2 years”?
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- How to implement WordPress plugin update that modifies the database?
- What is difference between get_bloginfo(‘url’) and get_site_url()?
- Custom media upload content for inserting custom post shortcode
- Stop a plugin in the activation process when a certain WP version is not met then show error message in admin_notices action hook
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How to Add an Index to Plugin Database table
- Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?
- how to create child WordPress plugin
- Redesigning Custom Post Type “Add New” page
- How to safely sanitize a textarea which takes full HTML input
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- Making my plugin multi-site compatible
- Why activate_plugin is not working in register_activation_hook
- Get plugin directory from a theme
- dealing with large HTML output via plugin code
- Best Practice for Referencing the Plugin Directory
- Getting Path To Uploaded Attachment Image After Upload
- Update plugin from personal API
- Giving Multiple Authors Access to a Plugin’s WP.org Repo
- Plugin upgrading: Widget settings
- Create a table in custom plugin on the activating it?
- How to call a plugin function from index.php
- dbDelta only creates the last table
- How would you require and automatically download dependent plugins?
- Update my custom WordPress Plugin through my own server [duplicate]
- Security and .htaccess
- Do plugin files have to follow a specific convention to be “picked up” by WordPress?
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- How can I make it so the Add New Post page has Visibility set to Private by default?
- My custom made plugin has “a new version available” which links to unrelated plugin
- wp.media update options and force render on uploader
- How to add custom rewrite rule to .htaccess?
- WordPress Plugin Development In MVC Architecture, How?