wp_get_canonical_url showing first url of the post for custom page
This is because wp_get_canonical_url can only be used on posts, and cannot be used for tags authors archives etc. Returns the canonical URL for a post. https://developer.wordpress.org/reference/functions/wp_get_canonical_url/ More specifically, no equivalent exists for tag archives because archives and listings do not have canonical URLs. A canonical URL indicates to a search engine the correct and … Read more