Having the FooGallery Albums extension activated seems to to disable the canonical redirect for the homepage of a site, allowing it to be accessed at both WWW.example.com and example.com URL. Naturally this can be manually disabled via the plugin files, but to disable this feature and make it update proof add the snippet below to your functions.php.

(at the time this is being written FooGallery is at version 1.6.1)

// stop foogallery albums extension from removing the canonical on homepage
function foogallery_canonical_fix(){
global $wp_filter;
foreach($wp_filter["redirect_canonical"][10] as $key => $hook){
if($hook["function"][1] == "disable_canonical_redirect_for_front_page") unset( $wp_filter["redirect_canonical"]->callbacks[10][$key]);
add_action( 'wp', 'foogallery_canonical_fix' );

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.