Home › Forums › General Issues › Use field to create URL
Hello,
I develop a travel agency website and I am using ACF pro. I started to add my fields and my itineraries can have some multi destinations as “Singapore, Thailand”, I would like to know if I can use my field as a slug to build my URL :
mytravelagency.com/singapore-thailand/my-itinary
or do I have to create a taxonomies for that…
Thanks,
Jonathan

In order for WP to automatically generate URLs they either need to be for posts (any post type) or for a taxonomy term.
Thanks you John. So I need to create custom taxonomies to generate my URL? ACP PRO cannot help me for this ? Right

There isn’t anything in ACF that will allow you to use values of fields as part of your URL string (slugs).
It is possible to do, but it’s complicated and beyond the scope of this forum. I can give you a basic idea of what’s involved.
First you need to create custom rewrite rules and custom url. Once you get that working then you need to build a pre_get_posts filter and a template redirect action that will cause WP to query for the correct post and show the right template. There is a basic outline of this here https://premium.wpmudev.org/blog/building-customized-urls-wordpress/
Thank you John.
So let build my URL with taxonomies 🙂
Hi please I want to add the advabced fields I created to my users account settings page. How do I go about that please? I notice that the newly created field does not appear on the user account settings page.
The topic ‘Use field to create URL’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.