最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

headers - disable wordpress canonical tag meta

matteradmin49PV0评论

wordpress core automatically generates canonical tag in HEAD section:

<link rel="canonical" href="" />

how to disable/remove that?

wordpress core automatically generates canonical tag in HEAD section:

<link rel="canonical" href="http://blabla" />

how to disable/remove that?

Share Improve this question asked Mar 7, 2014 at 18:51 T.ToduaT.Todua 5,8909 gold badges52 silver badges81 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 17

found solution: before wp_head() command, insert:

remove_action('wp_head', 'rel_canonical');

p.s. if generator meta tag is being added from elsewhere (i.e. from theme or plugin, rather than wp-core) and was priority other than 10, then you might need to put the exact priority, as is was given from that theme/plugin:

i.e. remove_action('wp_head', 'rel_canonical', 47);

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far