WordPress.org

Support

Support » Plugins and Hacks » Restrict post tags to prevent free tagging in write screen

Restrict post tags to prevent free tagging in write screen

Viewing 1 replies (of 1 total)
  • I found this on stackoverflow:

    Add the following code to the function.php file in the WordPress theme you are using. Take note of the closing and opening PHP tags. This will disable and hide the field and Add New Tag button making the only tagging option the pre-defined tags in the admin section.

    Big thanks to hsatterwhite for his reply, and it works well.

    function disable_tags()
    {
        ?>
        <script type='text/javascript'>
            jQuery(document).ready(function() {
                jQuery('#new-tag-post_tag').attr("disabled", "disabled").css("display", "none");
                jQuery('.tagadd').attr("disabled", "disabled").css("display", "none");
                jQuery('#post_tag').css("display", "none");
            });
        </script>
        <?php
    }
    add_action('admin_head', 'disable_tags');
Viewing 1 replies (of 1 total)
  • The topic ‘Restrict post tags to prevent free tagging in write screen’ is closed to new replies.
Skip to toolbar