Remove filter from WordPress Plugin


I am using a plugin called that causes all of distributed posts to have a rel=canonical back to the source. I reached out to the developers and they told me the following:

By default, canonical URL of distributed post will point to original content, which corresponds to SEO best practices. This can be overridden by extending Distributor with custom code and removing Distributor’s default front end canonical URL filtering (look for ‘get_canonical_url’ and ‘wpseo_canonical’).

Here is their code:

public static function canonicalize_front_end() {
    add_filter( 'get_canonical_url', array( 'DistributorInternalConnectionsNetworkSiteConnection', 'canonical_url' ), 10, 2 );
    add_filter( 'wpseo_canonical', array( 'DistributorInternalConnectionsNetworkSiteConnection', 'wpseo_canonical_url' ) );
    add_filter( 'wpseo_opengraph_url', array( 'DistributorInternalConnectionsNetworkSiteConnection', 'wpseo_og_url' ) );
    add_filter( 'the_author', array( 'DistributorInternalConnectionsNetworkSiteConnection', 'the_author_distributed' ) );
    add_filter( 'author_link', array( 'DistributorInternalConnectionsNetworkSiteConnection', 'author_posts_url_distributed' ), 10, 3 );

I went into my child theme functions.php file and added the following:

  remove_filter( 'get_canonical_url', array( 'DistributorInternalConnectionsNetworkSiteConnection', 'canonical_url' ), 10, 2 );
  remove_filter( 'wpseo_canonical', array( 'DistributorInternalConnectionsNetworkSiteConnection', 'wpseo_canonical_url' ) );

It doesn’t seem to work for me. Any thoughts?

, , user3096584 2 years 2019-12-02T16:40:06-05:00 0 Answers 97 views 0

Leave an answer