Last active
September 24, 2020 16:11
-
-
Save wp-seopress/cd88f7aad8a04ffa4c4899dc56b8b83b to your computer and use it in GitHub Desktop.
Filter canonical URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sp_titles_canonical($html) { | |
$html = '<link rel="canonical" href="'.htmlspecialchars(urldecode('https://example.com/my-canonical-url')).'" />'; | |
return $html; | |
} | |
add_filter('seopress_titles_canonical','sp_titles_canonical'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment