While selecting tags for the posts the user is able to create new tags on fly.

For example we have the tag 'animal' but the user misstpye it as 'aminal' - and Wordpress creates it.

In our blog the strict tag structure is essential. How can I disable this function?


Solution added.


YOu can deactive the default tag feature and add via plugin an custom taxonomie, that only list your created tags, like category meta box. Its also possible to design this how the tag meta box.

  • It is easy to remove an box via remove_meta_box(). Also, I think, do you find here on WPSE the soltuin for create an taxonomy. I have read this for longer time. – bueltge Jul 31 '12 at 10:56
  • not a solution for my problem :( it is really so hard to prevent users to create new tags? – boj Jul 31 '12 at 21:58


Adding a hook to the create_term action works. Two things to do:

  • Check the referer, and if it comes from 'post.php', die
  • but before stopping, delete the new (and unwanted) tag with wp_delete_term($term_id, "post_tag");

Source code as plugin

Plugin Name: Tag Checker

add_action('create_term', 'tag_checker_hook');

function tag_checker_hook($term_id) 
    $referer = $_SERVER['HTTP_REFERER'];

    if (strpos($referer, "/wp-admin/post.php") !== false)
        // Delete it
        wp_delete_term($term_id, "post_tag");

        wp_die("You are not able to create new tags.");

  • Now you're blocking yourself from creating new tags.. – amit Aug 1 '12 at 11:19
  • no, just from the 'Post' form - and that' the goal. – boj Aug 1 '12 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.