BBPress Duplicate Page Titles SEO

label_outlinechat_bubble_outline Comment

UPDATE

Due to my blog post and request directly to BBPress this will be fixed in Version 2.5. Please see the Ticket here and the Commit here.


BBpress is becoming more and more popular within the WordPress community as a quality forum plugin. It has come a very long way since it’s conception many years ago, but it still has some room to grow. As of this writing (09/19/2013) many SEO plugins can be used to modify the BBPress titles, metas and more to make the forum a bit more SEO friendly. Unfortunately, there’s still one area that these SEO plugins don’t get to very well, the /users/ slug.

BBPress duplicate page titles exist even on the bbpress.org website for all of the user profile areas that contain this slug (which is all of them). It’s common knowledge that we are never supposed to duplicate page titles. So why BBPress still does this is a complete mystery. The exact result of having too many duplicate page page titles isn’t really known, but what we do know is that duplicate content is bad for SERP. For more information on duplicate content directly from Google you can check out this page.

This all takes place in the /wp-content/plugins/bbpress/includes/common/template.php file around line 2563. We could make some changes here but that wouldn’t be the best idea because the next time we go to update the plugin our changes will be reverted and then we’ll be back to where we are now. So once again we’ll make the change in the function.php in a less than desirable way.

So lets get to edit by editing the functions.php in your WordPress theme folder:

Place the below code in the file:

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

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 - Your Site Name', $title);
		} elseif (false !== strpos($usrurl,'replies')) {
    		$title = str_replace('Profile', 'Replies Created - Your Site Name', $title);
		} elseif (false !== strpos($usrurl,'subscriptions')) {
    		$title = str_replace('Profile', 'Subscribed Threads - Your Site Name', $title);
		} elseif (false !== strpos($usrurl,'favorites')) {
    		$title = str_replace('Profile', 'Favorite Threads - Your Site Name', $title);
		} else {
    	$title = str_replace('Profile', 'Profile - Your Site Name', $title);
		}
    }
    return $title;
}

What we have done here is we have examined the url for the “users” slug. If the slug exists then we are going to dig deeper and look to see if the string also contains the “topics”, “replies”, “subscriptions”, or “favorites” slugs. It will then replace the word “Profile” that’s found in every BBPress page by default with the appropriate revision.

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

We’ll be making posts on the BBPress forums asking them to fix this, but until they do it looks like a little dirty search/replace will have to do.

If you found this post helpful please consider commenting or liking it.

From all of us at WireFlare we ask that you help others find the answers they are looking for. Please leave a comment or share this post!

About

Blog Bio Picture For Todd

I'm the President of WireFlare. I have a passion for creativity, online business and internet security. I strive to create a community that empowers people to be themselves. I'm an adventurist, fun loving and caring. Find me hiking in places most people don't dare to go!

Get a free consultation today!