An easy way to do this is to keep both your rewrite rules active (for now).
On single-event.php
you check for the URL, even before calling wp_header()
.
If the URL does not contain the base ‘workshop’, add a wp_redirect()
:
wp_redirect( get_permalink( get_the_ID() ) );
This way you should be all set. If you do not like the wp_redirect()
, you can of course just modify the header information with PHP.
I know this is not in the Plugin itself. If you really depend on the Plugin, you can do the same method by hooking into an early action.
Related Posts:
- URL rewriting must be activated manually for my plugin
- Why doesn’t flush_rewrite_rules run on plugin activation?
- rewrite URL based on selected taxonomy for post page
- Remove custom post type slug from URL and add taxonomy Slug
- add_rewrite_rule behaving strangely
- How to use permalink query to go to specific tabs in posts
- Custom rewrite, url path with parameters to a page
- A tool to analyze rewrite rules? [closed]
- Making a plugin file accessible via url rewrite?
- How to Rewrite WordPress URL for a Plugin
- permalinks with get variables
- WordPress plugin how to run function when button is clicked
- Custom Rewriting to Plugin with Parameters
- Filter to change the content of 404 page
- Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions
- Removing rules from .htaccess
- Mapping multiple URLs to same page
- Use an empty page to build custom plugin output
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Add Post and Comments menu no longer visible
- Rewrite url for existing page without flush_rewrite_rules
- Creating a path in a plugin to call a function
- Custom rewrite rule serves content, but returns 404 error code
- 404 errors after plugin options update and category base change
- How to change the URL pattern for single post view
- Redirect traffic to plugin
- Append country to ‘pretty’ url but serve same page
- Auto save permalink setting page with the plugin activation
- How To Consistently Enforce Rewrite Rule in Plugin Development
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- Help With Rewrite_Rules For a Custom Plug-In
- Append varible to url or set session
- Adding rewrite rule dynamically
- How can I turn a custom wordpress page into a product page?
- Problem with dinamic add_rewrite_rule()
- Custom Permalink to remove category word , keeping posts permalink with date?
- Help writing custom function with rewrite endpoint that generates a page from dynamic content
- Possible to get all posts with my shortcode?
- custom permalink’s rewrite rule for page id
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- Create page (not the post type) dynamically
- Show content without a post
- How can I add rewrite rules to a class-based plugin?
- How to get post image root URL?
- How to create new content type and flushes rewrite rules without visiting the permalinks page?
- configuration of .htaccess for add_rewrite_rule to make sense
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- How to embed a new string in url?
- Rewriting Image URLs from dynamic to original
- Changing permalink structure breaks link to .php file which generates files dynamically
- wp_insert_post generated mixed permalinks
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- Custom Path for a Plugin
- Custom post type change permalink query
- Add variables from rewrite rules to query var
- Change cannonical URL after changing url with add_rewrite_rule()
- Home page is not loading, where in other pages are displaying on the site
- Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin
- WordPress custom url without using any of the custom tags given
- Get the current post/page URL with plain permalinks
- Adding body class in author page for custom role
- Author Meta in Author URL Link
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- WordPress plugin how to run function when button is clicked
- Using meta_key & meta_value in add_rewrite_rule
- How to force download a plugin generated file?
- How to pass a more variable with page/subpage in Wordprees URL?
- Get (eventual) permalink from post within Edit Post in Admin panel
- Fixing the WP Post Object for Custom Route
- Any way to make Apache’s internal redirect work?
- WordPress permalink setting
- Rewriting URLs with a query string
- How can I send an id over the url?
- Custom slug in url for CPT and taxonomy
- add_rewrite_rule not working
- Mapping multiple URLs to same page
- Use custom clean URLs for a plug in
- How to Rewrite WordPress URL for a Plugin
- Virtual Page with Registration form
- Get URL of Post You Are Editing
- How to Rewrite WordPress URL for a Plugin
- redirect word-press page with page values
- URL rewrite parameter lost (add_rewrite_rule)
- Add self-closing shortcode button to TinyMCE in WP 4.6
- Help adding image upload functionality to widget
- Enqueue scripts in footer
- Including the necessary functions for a custom ajax registration form
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- Create custom permalinks to show Custom Post Type’s relationship?
- How to create custom settings page for custom plugin
- Taxonomies within plugin invalid
- Make Database query only when option is updated
- Ajax action has 200 status but response of No response data available for this request
- Google Web Core Vitals – management, how to in wordpress and advice
- Adding customs fields on each product on the cart
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- I have a plugin where in I have to change the title of the page dynamically by sending parameter to the_title filter
- How can I map a specific URL pattern to a plugin for processing
- Change the class of wordpress menu
- Is wordpress plugin development active? [closed]