Find out in this tutorial how to prevent BuddyPress users from being indexed in Google (and other search engines) using code.
BuddyPress is one of the most popular WordPress plugins to create something similar to a social network within a website. It is not the most “showy” but it has a robust code, and that is why I have used it on several occasions to implement it in my clients’ projects.
However, BuddyPress user profiles, groups and conversations are indexed in search engines by default. And in many cases, especially if they are private groups, you don’t want this to happen, do you?
Let’s see how to avoid it:
Snippet to prevent BuddyPress pages from being indexed in search engines
Add the following code snippet to your functionality plugin:
With this snippet you use as conditional the BuddyPress functions,
bp_is_groups() to add the noindex tag in the page header.
Do you want to prevent BuddyPress pages from being indexed and appearing in search engine results? Now you know how to do it with a little bit of code.
If you have any question, please leave it in the comments. And if you want to give me a suggestion for future snippets, please send it through the contact form.
Benefits of being a subscriber. 🙂