Skip to:
Content
Pages
Categories
Search
Top
Bottom

Duplicate Page Titles

  • I’m surprised that this far into the development of BBPress that we are still seeing duplicate titles for the users slug. Even here on bbpress.org they exist.

    Maybe not everyone does SEO work for a living, but when we get a customer that has BBPress installed and they have 100 users this turns into almost 1000 duplicate title errors on all of our reports. Not only does it look bad, but Google has publicly stated that they frown upon it and it’s widely known in the SEO community that it’s just not a good thing to do. So why does BBPress still do it?

    To make matters worse WP SEO plugins don’t change these titles either. Without hacking core BBPress files we’ve devised a crude way of doing this but I am writing this in hopes that someone will take this small request into consideration.

    In the mean time should anyone want to see or implement our way of getting around this problem please check out our blog post

Viewing 20 replies - 1 through 20 (of 20 total)

  • FreeWPress
    Participant

    @freewpress

    Please give us an example, how bbpress duplicate titles for users?


    FreeWPress
    Participant

    @freewpress

    Yes i understand this problem, in effect, user title for, favorite, reply created and topic started is egual… Now i have put your code:

    function bbpress_title_duplicates($title, $sep, $seplocation){
    	$usrurl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    	if (false !== strpos($usrurl,'users')) {
    		if (false !== strpos($usrurl,'topics')) {
        		$title = str_replace('Profile', 'Topics Started - TSCADFX', $title);
    		} elseif (false !== strpos($usrurl,'replies')) {
        		$title = str_replace('Profile', 'Replies Created - TSCADFX', $title);
    		} elseif (false !== strpos($usrurl,'subscriptions')) {
        		$title = str_replace('Profile', 'Subscribed Threads - TSCADFX', $title);
    		} elseif (false !== strpos($usrurl,'favorites')) {
        		$title = str_replace('Profile', 'Favorite Threads - TSCADFX', $title);
    		} else {
        	$title = str_replace('Profile', 'Profile - TSCADFX', $title);
    		}
        }
        return $title;
    }

    But don’t change title page, it only sho profile of… and nothing.. 🙁

    FreeWPress,

    What using this assumes:

    1 – That you are using BBPress version 2.4
    2 – That you don’t have anything else modifying these titles
    3 – That you haven’t changed the structure of the titles via the core files.
    4 – Your user slugs are as follows:
    User Base :users
    Topics Started :topics
    Replies Created :replies
    Favorite Topics :favorites
    Topic Subscriptions :subscriptions

    Following the above I have no clue why you would see “Profile Of”. The way that BBPress generates this Title is clearly shown on line 2563 of /wp-content/plugins/bbpress/includes/common/template.php which shows:

    	} elseif ( bbp_is_single_user() ) {
    
    		// Current users profile
    		if ( bbp_is_user_home() ) {
    			$new_title['text'] = esc_attr__( 'Your Profile', 'bbpress' );
    
    		// Other users profile
    		} else {
    			$new_title['text']   = get_userdata( bbp_get_user_id() )->display_name;
    			$new_title['format'] = esc_attr__( "%s's Profile", 'bbpress' );
    		}

    (Note that your file may contain $title in lieu of $new_title, this is because we are using a forked version, but that doesn’t change anything.)

    Therefore, the output of this should be either “Your Profile” or “Username’s ($s’s) Profile”. No where in that is “Profile of”. If you click on your profile here on bbpress.org you’ll see that it says “Your Profile” as well.

    Please check that everything in 1-4 is correct. This is the default way that BBPress is setup.

    Hope that helps. I have also added these requirements to my blog post to help clarify.


    FreeWPress
    Participant

    @freewpress

    Nothing to do… it non working for me.. Is possible because i use language translation?

    I use all in one seo pack, and it do not add | blogsitename.com in user pages and tags pages…

    Exist one solution with one filter to upgrade a original function located in template.php? Or another solution only for now?

    Go to a user page and copy the URL post the domain.tld and put it here in the forum so I can see your url structure.

    Because the work around that I’ve created is based on a copy/replace is has to be exactly correct based on the URL.


    FreeWPress
    Participant

    @freewpress

    Hi, i’m sorry, this is my configuration:
    wp 3.6.1
    bbp 2.4

    Nothing changed from my url structure

    my url structure is:

    http://www.sitename.com/forums/users/nickname/topics/

    only language is different, is in italian and it show this italian title: Il profilo di nickname

    in my template.php is used $title i can’t find $new_title

    Ok so because you are doing this in Italian it might be different. I’m not 100% sure that the below solution will work because I don’t have a site to test it on and I don’t know how the language translation hooks in. But lets try this:

    1 – Replace all instances of ‘Profile’ with ‘Il profilo di’
    2 – Replace the following:
    Topics Started –> Argomenti aperti da
    Replies Created –> Risposte creati dal
    Subscribed Threads –> Discussioni sottoscritte da
    Favorite Threads –> Discussioni preferite di


    FreeWPress
    Participant

    @freewpress

    Ok i go to do this do you have written… just a moment!!


    FreeWPress
    Participant

    @freewpress

    function bbpress_title_duplicates($title, $sep, $seplocation){
    	$usrurl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    	if (false !== strpos($usrurl,'users')) {
    		if (false !== strpos($usrurl,'topics')) {
        		$title = str_replace('il profilo di', 'Argomenti aperti - test', $title);
    		} elseif (false !== strpos($usrurl,'replies')) {
        		$title = str_replace('il profilo di', 'Risposte create - test', $title);
    		} elseif (false !== strpos($usrurl,'subscriptions')) {
        		$title = str_replace('il profilo di', 'Discussioni sottoscritte - test', $title);
    		} elseif (false !== strpos($usrurl,'favorites')) {
        		$title = str_replace('il profilo di', 'Topic preferiti - test', $title);
    		} else {
        	$title = str_replace('il profilo di', 'Profilo - p', $title);
    		}
        }
        return $title;
    }

    Nothing changed… show only: “Il profilo di nickname” Do not replace nothing.. This is impossible! :/


    FreeWPress
    Participant

    @freewpress

    Is possible to add only a little text after profile… without replace? For example:

    Todd Profile’s | Topic started | SiteName.com

    Only add the last part… | Topic started | SiteName.com

    FreeWPress,

    It is case sensitive therefore make sure that “il” is “Il” otherwise it won’t work.


    FreeWPress
    Participant

    @freewpress

    This is a print screen of my code:
    <title> Il profilo di sole38</title>

    I have written exactly this in function and not working!! Incredible!!

    Is too sensitive.. eheheheh…..

    FreeWPress,

    My sincere apologies. I forgot one line of code on the blog post. I’ve added it and corrected the blog post to reflect the forgotten line.

    Above all of the code that you have add this:

    add_filter('wp_title', 'bbpress_title_duplicates', 20, 3 );

    Again, my apologies for the oversight.


    FreeWPress
    Participant

    @freewpress

    I have a solution… thi is a correct code.. it work fine…

    function bbpress_title_duplicates($title, $sep, $seplocation){
    	$usrurl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    	if (false !== strpos($usrurl,'users')) {
    		if (false !== strpos($usrurl,'topics')) {
        		$title = str_replace('Il profilo di', 'Argomenti aperti da', $title);
    		} elseif (false !== strpos($usrurl,'replies')) {
        		$title = str_replace('Il profilo di', 'Risposte create da', $title);
    		} elseif (false !== strpos($usrurl,'subscriptions')) {
        		$title = str_replace('Il profilo di', 'Discussioni sottoscritte da', $title);
    		} elseif (false !== strpos($usrurl,'favorites')) {
        		$title = str_replace('Il profilo di', 'Topic preferiti da', $title);
    		} else {
        	$title = str_replace('Il profilo di', 'Il Profilo di', $title);
    		}
        }
        return $title;
    }
    add_filter('bbp_title', 'bbpress_title_duplicates');

    I’m glad it worked for you please considering liking my blog post or commenting on it.

    Share the love!


    FreeWPress
    Participant

    @freewpress

    Nooo.. eheheheh you have forgot a linee…. I don’t have read your message ehehehe… no problem and no panic eheheh….

    Create a ticket on Trac so we can work on getting something into bbPress core
    https://bbpress.trac.wordpress.org/

    Done Thanks!

    Marked as fixed in the upcoming 2.5 release. See the ticket here:

    https://bbpress.trac.wordpress.org/ticket/2430


    koendb
    Participant

    @koendb

    edit, nevermind. Should have posted on Buddypress forum

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