Skip to content

Use topic text for meta description in bbPress

I’m using bbPress on a couple of support forums. But a few days ago I went to share a thread on Facebook and noticed that the description coming from WordPress with Yoast SEO installed is showing the first part of the page content. In my case it was something like “This thread contains 2 voice, 3 posts” which is not what I want.

What I wanted was the text of the original post.

With a little filtering it wasn’t too tough.

I put this in my functions.php file since it was theme specific, but could be a really simple plugin as well.

Now it pulls the text from the original post and puts it into the meta description along with the open graph description fields.

Published inWordPress

3 Comments

  1. Javier Javier

    Thank you very much! Any extra code for bbpress is useful ;)

    It works perfect!

  2. Liss Liss

    Great tutorial, thank you. One question, How do I limit the length to 150 characters??

Leave a Reply

Your email address will not be published. Required fields are marked *