• Resolved sheinzle

    (@sheinzle)


    I am running the same website using different domains, but I would like to use only one as only canonical address.

    There is a way to define a canonical URL per post/page, but I haven’t found a global setting that let’s me choose my preferred domain to be used as canonical. Some googling suggested there might be a site-wide setting for this, but somehow I can’t find it.

    Any pointers? Thanks a lot in advance!

    https://wordpress.org/plugins/wordpress-seo/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Joost de Valk

    (@joostdevalk)

    There is a wpseo_canonical filter for just that reason. You’ll have to code a bit but not much.

    Thread Starter sheinzle

    (@sheinzle)

    Great, that’s what I needed. For reference, in case anybody has the same problem, here’s what I did:

    function gimalon_canonical($canonical) {
      return str_replace( home_url(), 'https://getcrowdapp.com', $canonical);
    }
    
    add_filter( 'wpseo_canonical', 'gimalon_canonical' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site-wide canonical’ is closed to new replies.