hi , for seo page url purpose, i need to append a custom field in the page url, is that possible ?
current url : site.com/post-type/ listing-name
prefer to have : site.com/post-type/custom-field-name/ listing-name
Pls advice the approach or if there is any ready sample to follow.
Thanks
Hi there,
Thank you for contacting us and I'll be happy to assist.
As the permalinks and their rewriting are managed by the WordPress, this question is better suited for the WordPress forum.
You'll get the most accurate and up-to-date information about possible challenges and drawbacks in adopting this approach:
https://wordpress.org/support/forums/
In theory, this will involve two steps,
1. Updating the saved permalink, when the post is saved, based on the custom field value.
( ref: https://toolset.com/documentation/customizing-sites-using-php/updating-types-fields-using-php/ )
2. Rewriting the URL itself.
Here is a link to a similar support thread on the topic:
https://wordpress.stackexchange.com/questions/294011/change-permalinks-with-acf-values
Note: As no two posts can share the same permalink, you'll also need to add a check that no two custom field values are the same.
I hope this helps! Please let us know if there's anything else we can help you with.