Thanks to Tom, I understood how this works…
- I did not have any pages with the URL
/shows-events/
so there is nowhere to redirect to - When the user accesses the existing page
/event/
, it triggers a redirect to/shows-events/
(which does not exist), but because of WordPress’ canonical redirect, it returns to the existing URL/event/
, which then causes an infinite loop
To resolve this, you may either:
- Remove the redirection entry
- or change your CPT slug
- or create a page with your target redirect URL
A useful tool when tracking URL redirects: https://wheregoes.com/
Related Posts:
- Child post with numeric only slug keeps redirecting to parent
- Can slugs from posts and custom post types conflict?
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Theme localization of “slugs” (custom post types, taxonomies)
- How do I get a post (page or CPT) ID from a title or slug?
- custom slug for custom post type
- Custom post type yearly/ monthly archive permalinks
- Disable permalink on custom post type
- Get list of all registered post types slugs
- Using Custom Fields in Custom Post Type URL
- How to throw error to user when saving post
- Dynamic taxonomy in permalink made all other posts NOT FOUND?
- Post slug changed using code doesn’t reflect on editor when post is published
- How can I fix those issues generated by the Themecheck plugin
- Taxonomy page returns 404 page not found
- How do I redirect all 404 errors of a specific post type to another URL?
- Reslug a Custom Post Type
- Removing CPT slug from URL results in 404 error for archive page
- Custom Post Type pagination when CPT ‘rewrite’ rule and a page have the same slug
- Getting Post ID from slug during init
- The editor has encountered an unexpected error. // TypeError: Cannot read property ‘prefix’ of null
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- Custom post type’s slug gets wrong when adding a custom meta box
- How can I fix a slow redirect after form submit from frontend (no plugin)?
- Rewrite CPT slug with two taxonomy slug instead of one
- Bulk 301 redirect for custom post type
- Can’t edit Custom Post Type slug/permalink
- Redirect to post with only post ID in the URL vs post_type/post ID
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Custom Taxonomy breaking pages permalinks
- Check Title Unique Or Not and If not error message and dont save
- Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
- Custom post type with slug for plural (archive) and for single
- Rewrite rules for custom post type slug
- How to redirect wp-admin/index.php to a custom post type?
- Automaticly add slug to posts
- Make slug as ID Number for custom post types
- Different permalink for CPT and regular Posts/Pages but why?
- Custom Post Type without an archive page
- Custom post type and taxonomy slug issue
- Redirect page to first post in custom post type
- Custom post types archive redirect
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Create/Edit posts and auto-redirect back to listing page
- Remove post type slug of all post types from permalinks
- CPT custom archive template does not get loaded
- Am I using the flush_rewrite_rules function in the right place?
- Rewrite post type slug only for child theme
- 301 redirect for converted post type
- How to add a post slug to a url?
- Permalink for a custom post type isn’t working and I don’t know why
- Trouble with CPT Child 404
- How can I make the slug of the taxonomy also the slug of the custom post
- Assign same parrent Page to pages AND custom post types
- Allow duplicate slugs for custom post type with taxonomies
- Nested Custom Post Type or Custom Post Type Parents?
- Programmatically rewriting slug through functions.php but returns 404
- Redirect custom post type category to other custom post type category
- Multiple (two) category postings on the same page.
- Some posts from custom post type to subdomains
- How do you create %post_type%/%postname%/ permalink structure?
- Slug for custom post type
- Slug Confusion Between Post and Custom Post types?
- Different slug taxonomy for two different CPT
- Redirect to archive is single post has a certain term assigned to it?
- How to get postname in custom page?
- WordPress Custom Post Type – Rewrite Query
- Query not work for current taxonomy
- Create short URL with auto 301 redirect
- Changing CPT slug and taxonomy already registered in parent theme
- Custom Post Type for Shortcode Use – Prevent it display as a post (with slug)
- Custom Post Types and Removing Slugs – should we do it?
- Need to return a string as permalink insted of str_replace
- Custom taxonomy permalink without term, redirection to CPT slug
- Custom post type and multi taxonomies + customize url
- Redirect Existing Post to CPT
- Use custom post type taxonomy between cpt slug and name
- Show code dependant on CPT & category
- I have a random letter appearing before my content. Where to start looking for the cause?
- How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?
- Change permalink incrementor into pseudo-subdirectory
- Custom Post Type duplicating slug for new posts
- Custom 404 redirect for a luddite
- WordPress page not showing up – replaced with last 10 posts?
- WP gives 404 error for custom post type with GET variable
- Display a Custom Post Type within another with hierarchically slug
- Redirect sub-page URLs to parent without changing URL
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Generate slug and meta data if meta field is empty
- Redirect Custom Post Type after user submits update
- Redirection error after posting a comment on a custom type post
- Costum post type with costum (sub)taxonomy
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Custom Post Type Rewrite Rule
- How can I retrieve the slug for a custom post type via name?
- WP Query WordPress Post Type with the same Taxonomy name
- Ideal top-level slug methods
- Create page using same slug as custom post type
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Removing custom post type name from permalink