Support » Plugin: Yoast SEO » canonical URL problem

  • Resolved diEfoRyoU

    (@dieforyou)


    hi i want set canonical URL’s like this:
    i need functions code.

    category/page/2 page/3 page/4… >> canonical url= “sitename/category”
    sitename/page/2 page/3 page/4… >> canonical url= “sitename.com”

    i was using this code but not working now:

    function return_canon () {
    $canon_page = get_pagenum_link(1);
    return $canon_page;
    }
    
    function canon_paged() {
    if (is_paged()) {
    add_filter( 'wpseo_canonical', 'return_canon' );
    }
    }
    add_filter('wpseo_head','canon_paged');
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change (core) features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. And even though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.

    Plugin Support Jerlyn

    (@jerparx)

    Closed. No other concerns.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘canonical URL problem’ is closed to new replies.