Fixed: SEO link canonical for the profile page

This commit is contained in:
denisbaranov
2020-06-19 17:56:49 +03:00
parent 60339b59cb
commit 3851781161
3 changed files with 60 additions and 6 deletions
+6 -3
View File
@@ -608,9 +608,13 @@ if ( !function_exists( 'um_profile_remove_wpseo' ) ) {
/* Yoast SEO 14.1 */
remove_all_filters( 'wpseo_head' );
/* Restore title and canonical if broken */
if( ! has_action( 'wp_head', '_wp_render_title_tag' ) ){
add_action( 'wp_head', '_wp_render_title_tag', 18 );
}
if( ! has_action( 'wp_head', 'rel_canonical' ) ){
add_action( 'wp_head', 'rel_canonical', 18 );
}
}
}
@@ -619,7 +623,7 @@ add_action( 'get_header', 'um_profile_remove_wpseo', 8 );
/**
* Meta description
* The profile page SEO tags
*
* @see https://ogp.me/ - The Open Graph protocol
* @see https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary - The Twitter Summary card
@@ -659,9 +663,8 @@ function um_profile_dynamic_meta_desc() {
?>
<!-- START - Ultimate Member profile SEO meta tags -->
<link rel="canonical" href="<?php echo esc_url( $url ); ?>"/>
<link rel="image_src" href="<?php echo esc_url( $image ); ?>"/>
<meta name="description" content="<?php echo esc_attr( $description ); ?>"/>
<meta property="og:type" content="profile"/>