• Resolved mbounds

    (@mbounds)


    Currently the Ajax Filter Plugin inserts a canonical tag into the wordpress <head> section of the page.

    How would I go about turning this off?

    It causes issues for us for a couple of reasons

    1) The plugin is specifying a version of the page without the trailing slash, which is the wrong one for various reasons. (If we could change it to add the trailing slash that would be an improvement)

    2) It conflicts with the Yoast plugin in so far as it is specifying a different canonical URL to Yoast.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dmytro Holovnia

    (@dholovnia)

    Hi,

    Add any you like to the functions.php in your child theme.

    Remove trailing slash code:

    
    add_filter( 'berocket_wp_head_canonical_page_url', 'berocket_wp_head_canonical_page_url_r34g78028r938p' );
    function berocket_wp_head_canonical_page_url_r34g78028r938p( $current_page_url ) {
        return rtrim( $current_page_url, "/" );
    }
    

    Add trailing slash code:

    
    add_filter( 'berocket_wp_head_canonical_page_url', 'berocket_wp_head_canonical_page_url_r34gg456028r938p' );
    function berocket_wp_head_canonical_page_url_r34gg456028r938p( $current_page_url ) {
        return rtrim( $current_page_url, "/" ) . "/";
    }
    

    Disable canonical functionality code:

    
    add_filter( 'berocket_wp_head_canonical', 'berocket_wp_head_canonical_434g934tgr3' );
    function berocket_wp_head_canonical_434g934tgr3() {
        return false;
    }
    

    Regards,
    Dima

    Thread Starter mbounds

    (@mbounds)

    Awesome. Thanks very much Dima, that worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing Canonical Tag From Header’ is closed to new replies.