• Resolved Grzegorz.Janoszka

    (@grzegorzjanoszka)


    This plugin does almost everything I could imagine from such type of plugin. The only remark I have is regarding excerpts. I use SEO plugin and all my content has a nice excerpt for SEO purposes. Currently I use Yoast’s SEO plugin, previously I had All in 1 WP SEO. Yoast use field “Meta description” which is what I would like to use as an excerpt.
    Is there an option to take excerpts from those plugins?
    Thanks for any help.

    https://wordpress.org/plugins/contextual-related-posts/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ajay

    (@ajay)

    I’m not familiar with the function to pull the custom excerpt from these plugins, but you could create your own filter in your functions.php to filter crp_excerpt something like this.

    function filter_crp_excerpt( $output, $id, $excerpt_length, $use_excerpt ) {
    
      $get_yoast_excerpt = YOUR FUNCTION HERE TO GET THE EXCERPT;
      $output = $get_yoast_excerpt;
      return $output;
    }
    add_filter( 'crp_excerpt', 'filter_crp_excerpt', 10, 4 );
    Thread Starter Grzegorz.Janoszka

    (@grzegorzjanoszka)

    Well, I saw cases of one plugin importing data from another (completely different authors) and I just hoped you could implement something like that to the most popular SEO plugin.

    Plugin Author Ajay

    (@ajay)

    Hi, You can use $wpseo_front->metadesc to get the meta description.

    Can you try adding this to your functions.php of your theme. Please note that this isn’t tested. It requires you to have WordPress SEO by Yoast activated. Please make sure you backup the original files when replacing them.

    function filter_crp_excerpt( $output, $id, $excerpt_length, $use_excerpt ) {
    
      $output = WPSEO_Meta::get_value( 'metadesc' , $id );
      return $output;
    }
    add_filter( 'crp_excerpt', 'filter_crp_excerpt', 10, 4 );
    Thread Starter Grzegorz.Janoszka

    (@grzegorzjanoszka)

    Hi Ajay,

    I know I can modify my code, but my idea was that your plugin fetches the data. WordPress SEO by Yoast has about 12.25 mln downloads, All in One SEO Pack has more than 19 mln downloads. They are widely used and I think lot of people would appreciate if your plugin could fetch the meta descriptions from them.

    I see it like that: if there is a WP excerpt, take it, if not check for existence of WordPress SEO by Yoast and All in One SEO Pack and take meta descriptions from one of them – I don’t think anyone would have them both installed.

    Google, Facebook, Bing and all other sites correctly see the proper excerpt from my SEO plugin, it is only your plugin that doesn’t see it. I would love to have such possibility added to your plugin, as it is one of the best related comments plugins.

    Thank you in advance for considering it.

    Plugin Author Ajay

    (@ajay)

    Understood. Does make sense. Let me put this on my list of things to add to the plugin.

    Thread Starter Grzegorz.Janoszka

    (@grzegorzjanoszka)

    Awesome, thank you so much! For the time being I am marking this topic as resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Excerpt from SEO plugins’ is closed to new replies.