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.
Thank you very much! Any extra code for bbpress is useful ;)
It works perfect!
Great tutorial, thank you. One question, How do I limit the length to 150 characters??
https://www.php.net/manual/en/function.substr.php