@fidoboy
You can try this code snippet where the meta property="og:
lines are removed and you can change all the remaining lines as you like:
remove_action( 'wp_head', 'um_profile_dynamic_meta_desc', 20 );
add_action( 'wp_head', 'um_profile_dynamic_meta_desc_custom', 20 );
/**
* 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
* @see https://schema.org/Person - The schema.org Person schema
*/
function um_profile_dynamic_meta_desc_custom() {
if ( um_is_core_page( 'user' ) && um_get_requested_user() ) {
$user_id = um_get_requested_user();
if ( $user_id !== um_user('ID') ) {
um_fetch_user( $user_id );
}
/**
* Settings by the priority:
* "Search engine visibility" in [wp-admin > Settings > Reading]
* "Profile Privacy" in [Account > Privacy]
* "Avoid indexing my profile by search engines in [Account > Privacy]
* "Avoid indexing profile by search engines" in [wp-admin > Ultimate Member > User Roles > Edit Role]
* "Avoid indexing profile by search engines" in [wp-admin > Ultimate Member > Settings > General > Users]
*/
if ( UM()->user()->is_profile_noindex( $user_id ) ) {
echo '<meta name="robots" content="noindex, nofollow" />';
return;
}
$locale = get_user_locale( $user_id );
$site_name = get_bloginfo( 'name' );
$twitter = (string) um_user( 'twitter' );
if ( ! empty( $twitter ) ) {
$twitter = trim( str_replace( 'https://twitter.com/', '', $twitter ), "/ \n\r\t\v\0" );
}
$title = trim( um_user( 'display_name' ) );
$description = um_convert_tags( UM()->options()->get( 'profile_desc' ) );
$url = um_user_profile_url( $user_id );
$size = 190;
$sizes = UM()->options()->get( 'photo_thumb_sizes' );
if ( is_array( $sizes ) ) {
$size = um_closest_num( $sizes, $size );
}
$image = um_get_user_avatar_url( $user_id, $size );
$person = array(
"@context" => "https://schema.org",
"@type" => "Person",
"name" => esc_attr( $title ),
"description" => esc_attr( stripslashes( $description ) ),
"image" => esc_url( $image ),
"url" => esc_url( $url ),
);
um_reset_user();
?>
<!-- START - Ultimate Member profile SEO meta tags -->
<link rel="image_src" href="<?php echo esc_url( $image ); ?>"/>
<meta name="description" content="<?php echo esc_attr( $description ); ?>"/>
<meta name="twitter:card" content="summary"/>
<?php if ( $twitter ) { ?>
<meta name="twitter:site" content="@<?php echo esc_attr( $twitter ); ?>"/>
<?php } ?>
<meta name="twitter:title" content="<?php echo esc_attr( $title ); ?>"/>
<meta name="twitter:description" content="<?php echo esc_attr( $description ); ?>"/>
<meta name="twitter:image" content="<?php echo esc_url( $image ); ?>"/>
<meta name="twitter:image:alt" content="<?php esc_attr_e( 'Profile photo', 'ultimate-member' ); ?>"/>
<meta name="twitter:url" content="<?php echo esc_url( $url ); ?>"/>
<script type="application/ld+json"><?php echo json_encode( $person ); ?></script>
<!-- END - Ultimate Member profile SEO meta tags -->
<?php
}
}
-
This reply was modified 2 years, 8 months ago by
missveronica.