There is a <link> , you need <link href="http://сайт.ру/odeyala/?filter_ocfilter=43:4078;42:484" rel="canonical" 1=""> cut the link, that is, href="http://сайт.ру/odeyala/ get this type of href

 $(function() { $("#aaa").each ( function() { alert ( $(this).attr ( "href" ).substring ($(this).attr ( "href" ).split('/?') ) ); }); }); 

    2 answers 2

    According to the previous comment, if I understood correctly it will be:

     $('#aaa').attr('href', $('#aaa').attr('href').split('/?') [0]) 

    In your case

     $(function() { $("#aaa").each ( function() { alert ( $(this).attr('href', $(this).attr('href').split('/?')[0])); }); }); 
    • thank!! exactly what is needed! - Andrey Vasilyev

    <link id="aaa" href="http://site/odeyala/?filter_ocfilter=43:4078;42:484" rel="canonical" 1="">