Home › Forums › General Issues › Change canonical tag with custom field › Reply To: Change canonical tag with custom field
I would not use that code.
The function rel_canonical() calls wp_get_canonical_url(). The value returned from this function is filterable. I would use this hook and create a filter to replace what WP is using. This is how the plugins you’ve mentioned to this.
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.