Permalinks Malformed if Taxonomy Not Set
-
Hello,
With a custom post type that has two taxonomies (tax1 and tax2 for this example), if the permalink setting is set to …
/%tax1%/%tax2%/%postname%/
… and the post has no taxonomy set then the permalink is set as …
https://example.com/custom-post-type/%tax1%/%tax2%/example-post/
… which breaks the site (Error 400 Bad Request). Similarly if tax1 is missing but tax2 is set …
https://example.com/custom-post-type/%tax1%/example-tax2/example-post/
… again, this breaks with the 400 error.
Finally, if tax1 is set but tax2 is not the permalink works but tax1 taxonomy is duplicated …
https://example.com/custom-post-type/example-tax1/example-tax1/example-post/
None of these outcomes are expected. Do you think you might be able to change the permalink creation so that if a taxonomy is missing from a post then that part of the permalink is omitted rather than being duplicated or producing a broken permalink?
Thank you,
Oliver
- The topic ‘Permalinks Malformed if Taxonomy Not Set’ is closed to new replies.