• Resolved cobbyjuk

    (@cobbyjuk)


    Hello all.

    I am using Yoast and also using a plugin called Listivo which doesnt work great with SEO.

    In my sourcecode it has the following

    <meta property="og:description" content=site description"
    
    but not
    
    <meta name="description" content=site description"

    In the Yoast settings for Listings there is no option for the description veriable only %title%

    is there a way to fix this or to clone the og:description to description?

    Any help would be amazing.

    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • @cobbyjuk

    We understand you do not see a meta description output on the page source of your Listing page. If this meta tag is missing, there are a few things to check in your Yoast SEO settings and the respective theme file. Let’s go through them.

    We hope one of these conditions helps you figure out why the meta description was not outputted on the given page.

    Thread Starter cobbyjuk

    (@cobbyjuk)

    Hello,

    Yes it has all those, if i write a set description on the listing section or a specific listing it works and shows.

    The issue is that it does not automatically add the description from the listing itself, the description shows on the og:description but not the actual meta description.

    What i need is a way to copy the og:description to description meta tag.

    this is doing lots of issues to my seo as the description meta tag is not there.

    Kind Regards,

    Chris

    Thread Starter cobbyjuk

    (@cobbyjuk)

    I have uploaded a screenshot.

    https://cdn.comic.place/wp-content/uploads//2023/03/yoast.jpg

    There is no option for description in there for the description variable

    Thread Starter cobbyjuk

    (@cobbyjuk)

    I am not a php developer so wondering if someone could help.

    If we edit to the meta-description-presenter.php file with the og:description parts would that work?

    Thread Starter cobbyjuk

    (@cobbyjuk)

    I have solved the issue now.

    Edit meta-description-presenter.php and replace with the following

    <?php
    
    namespace Yoast\WP\SEO\Presenters;
    
    use Yoast\WP\SEO\Presentations\Indexable_Presentation;
    
    /**
     * Presenter class for the meta description.
     */
    class Meta_Description_Presenter extends Abstract_Indexable_Tag_Presenter {
    
    	/**
    	 * The tag key name.
    	 *
    	 * @var string
    	 */
    	protected $key = 'description';
    
    	/**
    	 * Returns the meta description for a post.
    	 *
    	 * @return string The meta description tag.
    	 */
    	public function present() {
    		$output = parent::present();
    
    		if ( ! empty( $output ) ) {
    			return $output;
    		}
    
    		if ( \current_user_can( 'wpseo_manage_options' ) ) {
    			return '<!-- ' .
    				\sprintf(
    					/* translators: %1$s resolves to Yoast SEO, %2$s resolves to the Settings submenu item. */
    					\esc_html__( 'Admin only notice: this page does not show a meta description because it does not have one, either write it for this page specifically or go into the [%1$s - %2$s] menu and set up a template.', 'wordpress-seo' ),
    					\esc_html__( 'Yoast SEO', 'wordpress-seo' ),
    					\esc_html__( 'Settings', 'wordpress-seo' )
    				) .
    				' -->';
    		}
    
    		return '';
    	}
    
    	/**
    	 * Run the meta description content through replace vars, the wpseo_metadesc filter and sanitization.
    	 *
    	 * @return string The filtered meta description.
    	 */
    	public function get() {
    		$meta_og_description = $this->replace_vars( $this->presentation->open_graph_description );
    
    		/**
    		 * Filter: 'wpseo_opengraph_desc' - Allow changing the Yoast SEO generated Open Graph description.
    		 *
    		 * @api string The description.
    		 *
    		 * @param Indexable_Presentation $presentation The presentation of an indexable.
    		 */
    		$meta_og_description = \apply_filters( 'wpseo_opengraph_desc', $meta_og_description, $this->presentation );
    		$meta_og_description = $this->helpers->string->strip_all_tags( \stripslashes( $meta_og_description ) );
    		return \trim( $meta_og_description );
    	}
    }
    
    

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘No Meta Description’ is closed to new replies.