Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress and Yoast SEO conflict – How to change the meta title for the replies?

Viewing 11 replies - 26 through 36 (of 36 total)

  • Robin W
    Moderator

    @robin-w

    This should do it if I have the right yoast meta name

    add_action ('bbp_new_reply', 'add_yoast_title' , 10 , 7) ;
    
    function add_yoast_title ( $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author, $false, $reply_to ) {
    	$topic_title = get_the_title ($topic_id) ;
    	$title = 'Reply to:'.$topic_title ;
    	update_post_meta ($reply_id , '_yoast_wpseo_title' , $title ) ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets


    defiance12
    Participant

    @defiance12

    <meta property="og:title" content="| Nerdpunk">

    didn’t work 🙁


    Robin W
    Moderator

    @robin-w

    so is that what it was before?


    defiance12
    Participant

    @defiance12

    yeah


    Robin W
    Moderator

    @robin-w

    sorry – I’m trying to help, but I don’t use yoast on any of my sites, so I’m guessing a bit.

    Where are you getting that bit from – database, something in the dashboard or where?


    defiance12
    Participant

    @defiance12

    in the <head> </head> tags in developer mode in chrome


    Robin W
    Moderator

    @robin-w

    and is that for a new reply – the code sets this for new replies


    defiance12
    Participant

    @defiance12

    so goto https://nerdpunk.com.au/reply/3957/ in chrome hit F12 then where u see the header tags expand it to see the seo meta data 🙂


    defiance12
    Participant

    @defiance12

    OMG you are awesome thanks so much! did a new reply and it worked!

    <meta property="og:title" content="Reply to:Some New Cyberpunk 2077 Gameplay">

    Reply To: Some New Cyberpunk 2077 Gameplay

    Just one small detail, how do I add a space between the Reply to:Some New Cyberpunk 2077 Gameplay


    defiance12
    Participant

    @defiance12

    oh actually nevermind figured it out 🙂


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed

Viewing 11 replies - 26 through 36 (of 36 total)
  • You must be logged in to reply to this topic.
Skip to toolbar