_bp_maybe_remove_rel_canonical()

Remove WP’s rel=canonical HTML tag if we are trying to load BP-specific content.

Description

This function should be considered temporary, and may be removed without notice in future versions of BuddyPress.

Source

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

function _bp_maybe_remove_rel_canonical() {
	if ( ! bp_is_blog_page() && ! is_404() ) {
		remove_action( 'wp_head', 'rel_canonical' );
		add_action( 'bp_head', 'bp_rel_canonical' );
	}
}

Changelog

Changelog
Version Description
BuddyPress 1.6.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.