Support » Plugin: Yoast SEO » Customize og:title using presenters

  • Resolved Villages-News.com

    (@villages-newscom)


    I’m trying to figure out a way to customize the og:title that Yoast outputs. I do this to remove the site name and just leave the title of the article. I am currently using the filter below. However, I understand that parts of it have been deprecated. Has anyone done something similar with presenters?

    add_filter( 'wpseo_opengraph_title', function($title){
    
    	global $post;
    	
    	$meta = get_post_meta($post->ID, '_yoast_wpseo_opengraph-title', true);
    	
    	// use post title only if og:title is not set
    	if( empty($meta) && !empty($post->post_title) ){
    		$title = $post->post_title;
    	}
    	
    	return $title;
    });
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    As much as we hate to say it, your question goes beyond the technical expertise of me and my colleagues on the Yoast support team. This means we can’t give you a solid answer to your question.

    But we don’t want to leave you empty-handed either, that’s why we’ve created our developer portal at developer.yoast.com. This has proven to be useful to many developers in the past, and hopefully will serve you well too.

    Sorry we can’t be of more help here.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.