From 7512b6f2c470e15bff09ece9542c36cfe560e7c9 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 7 Jul 2016 15:03:19 -0400 Subject: [PATCH] Adding link to a Yoast SEO filter to stop it from creating incorrect canonical page links. --- index.php | 4 ++-- setup/frontHooks.php | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 06c533a9..375e669e 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 2.1.24 + * Version: 2.1.25 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -38,7 +38,7 @@ * */ -define('GLM_MEMBERS_PLUGIN_VERSION', '2.1.24'); +define('GLM_MEMBERS_PLUGIN_VERSION', '2.1.25'); define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.11'); // Check if plugin version is not current in WordPress option and if needed updated it diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 30ad731a..45e9b093 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -104,6 +104,14 @@ add_action('init', function() { return; }); // do_action 'init' +/* + * Kill Yoast SEO canonical page links in headers. They override the correct canonical links farther down in the header. + * Yoast does not have an option for this like some other SEO plugins do. + */ +add_filter( 'wpseo_canonical', function($canonical) { + return false; +}); + /* End of rel_canonical code */ -- 2.17.1