I don’t know if this fixes?
BBpress Addon For Yoast SEO
if it does come back and tell us
Thanks for your answer. This only does that the topics in BBpress displays the correct meta description from Topic Content. But I need it also for the Reply-Pages, like I mentioned.
thanks – I’m just a user who helps out here, not a bbpress author.
so
1. can you confirm that the above plugin is not necessary – bbpress already does this ?
2.
can you try this code
add_filter( 'wpseo_metadesc', 'rew_meta_desc' );
function rew_meta_desc( $content ) {
global $post;
if ($post->post_type == 'reply' ) {
$order = $post->menu_order ;
$post_parent = $post->post_parent ;
$title = get_the_title ($post_parent) ;
$content = $title.' '.$order ;
}
return $content;
}
Put this in your child theme’s function file – or use
Code Snippets
Thank you very much for your response.
This only changes the Meta Description, right? Is there an option, to also change the Meta Title (And like I said, it should be unique, so we can avoid duplicate titles)
Thank you very much!
ah, I understand, sorry not really into SEO
try this
add_filter( 'wpseo_metatitle', 'rew_meta_title' );
function rew_meta_title( $title ) {
global $post;
if ($post->post_type == 'reply' ) {
$order = $post->menu_order ;
$post_parent = $post->post_parent ;
$topic_title = get_the_title ($post_parent) ;
$title = $topic_title.' '.$order ;
}
return $title;
}
And again, thank you very much for your help.
It didn’t change anything on the BBPRESS – Reply Pages, for example:
https://www.paastoa.com/antworten/8907/
Is the code you sent me really for BBPRESS? I think it’s for the normal replies…
post type reply is definately bbpress.
so how would I know from the link whether it is working – what am I looking for ?
I don’t have any sites with both yoast and forums on them (my forum sites are profession related sites with private forums so don’t want to advertise!).
So I don’t know which part of the code is faulty.
If you are able to test, then start with
add_filter( 'wpseo_metatitle', 'rew_meta_title' );
function rew_meta_title( $title ) {
if ($post->post_type == 'reply' ) {
$title = 'this is a reply' ;
}
return $title;
}
this should make the title of each reply ‘this is a reply’
if that works, then we kwow the function is working, but not getting the right answer !
If it doesn’t work, then I’ll come back with another
Changed it, but it doesn’t appear on the website: https://www.paastoa.com/antworten/8907/
Thx for your help
ok, can I ask again
so how would I know from the link whether it is working – what am I looking for ?
You can check the Title in the Browser-Tab. Currently, it’s showing the following text:
| Paastoa
So it’s only the seperator and the website title…
Also when you open the source code of the page, it shows:
<title>| Paastoa</title>
URL: https://www.paastoa.com/antworten/8907/
Thanks for your help.
thanks – just to ask the obvious, you are running the yoast plugin ?? 🙂
then as a test can you try a correction to my previous code
add_filter( 'wpseo_metatitle', 'rew_meta_title' );
function rew_meta_title( $title ) {
global $post ;
if ($post->post_type == 'reply' ) {
$title = 'this is a reply' ;
}
return $title;
}
if that fails, can you try (as a test only)
add_filter( 'wpseo_metatitle', 'rew_meta_title' );
function rew_meta_title( $title ) {
$title = 'this is a reply' ;
return $title;
}
This should put that phase at the top of every pages, and will at least show that the filter is working.
sure, yoast SEO (Also Premium version) is enabled.
I tried both of the codes you sent me, both doesn’t have an effect on the Meta Title.
The snippet with the following code is still activated on the website:
add_filter( 'wpseo_metatitle', 'rew_meta_title' );
function rew_meta_title( $title ) {
global $post ;
if ($post->post_type == 'reply' ) {
$title = 'this is a reply' ;
}
return $title;
}
So you can check, if there happend something. I deleted the other snippet because it also didn’t had an effect on the website. But when it has an effect, it’s not so good because the website is live.
Thanks for your time.
thanks, ok lets try this
add_filter( 'wpseo_title', 'rew_meta_title' );
function rew_meta_title( $title ) {
global $post ;
if ($post->post_type == 'reply' ) {
$title = 'this is a reply' ;
}
return $title;
}
That makes, that the page disappears: https://www.paastoa.com/antworten/8907/
:’D
ok, so not the way to go.
Let me have a think
I think your code did something really bad, it redirects my forums now to other pages… what can I do?
For example: https://www.paastoa.com/forum/intervallfasten/
ok, suggest you go into these in the backend and resave them
Do you have an idea how and where?
Ok I fixed it with deactivating and activating bbpress again.
this works however the meta title needs to include the post title also e.g.
Reply To: %forum post title%
What code is needed to add this?
Thanks!