bp_remove_adjacent_posts_rel_link()

Remove “prev” and “next” relational links from <head> on BuddyPress pages.

Description

WordPress automatically generates these relational links to the current page. However, BuddyPress doesn’t adhere to these links. In this function, we remove these links when on a BuddyPress page. This also prevents additional, unnecessary queries from running.

Source

File: bp-core/bp-core-functions.php

function bp_remove_adjacent_posts_rel_link() {
	if ( ! is_buddypress() ) {
		return;
	}

	remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );
}

Changelog

Changelog
Version Description
BuddyPress 2.1.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.