Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Conditional Meta Tags per Page Type, and More?


_ck_
Participant

@_ck_

It’s very easy to do this via a plugin.

You have to attach to the ‘bb_head’ action.

In fact if there’s a plugin for WordPress that does it, it would take under a minute to change it for bbPress.

Here’s a mini-plugin I wrote to do noarchive and nofollow:

function no_archive() {
echo "n".'<meta NAME="robots" CONTENT="noarchive,nofollow">'."n";
} add_action('bb_head', 'no_archive');

.

It would just have to be wrapped in an IF statement with a URI check to add it when you want it. To get the current location, either check bb_get_location or steal it’s code and modify as desired.

Something like this (untested)

function no_index() {
if (in_array(bb_get_location(),array("login-page","register-page","profile-page")) {
echo "n".'<meta NAME="robots" CONTENT="noindex,nofollow">'."n";
}
} add_action('bb_head', 'no_archive');

Skip to toolbar