Here is what I came up with, seems to work:
add_filter( 'pre_post_tags_input', 'no_tags_input_create' );
add_filter( 'pre_post_tax_input', 'no_tax_input_create' );
function no_tags_input_create($tags_input) {
$output = array();
foreach( $tags_input as $tag )
if( term_exists( $tag, 'post_tag') )
$output[] = $tag;
return $output;
}
function no_tax_input_create($tax_input) {
if( !isset($tax_input['post_tag']) )
return $tax_input;
$output = array();
$tags = explode(',', $tax_input['post_tag']);
foreach( $tags as $tag )
if( term_exists( $tag, 'post_tag') )
$output[] = $tag;
$tax_input['post_tag'] = implode(',',$output);
return $tax_input;
}
This is for tags, you can easily extend second function to handle custom taxonomies.
Related Posts:
- Can I turn off write-in tags/taxonomies?
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- How to remove the tag cloud from custom taxonomy admin page?
- Custom columns on edit-tags.php main page
- custom post type taxonomy “tag” archive : no post found
- Exclude Specific Term from Search
- get_term_by not working when in functions.php
- Is it possible to use one slug for Multiple Taxonomies?
- Widget to display custom taxonomy tag cloud
- Formating the_terms() function output
- Find callback function for custom taxonomy metabox
- Scheduling posts to update once per day with wp_cron
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue
- How to display and use all existing tags at my write-post-at-frontend-panel?
- Possible to register multiple custom taxonomies in one function?
- how to get title to custom tags page
- How do I add customize_register action AFTER adding a custom taxonomy
- WordPress renames slug of tags used in multiple taxonomies?
- Allow only 1 instance of each term in each custom taxonomy
- How do I make a custom taxomony appear like tags?
- Adding ‘active’ class to custom taxonomies using walker in functions.php
- Make tag cloud links consistent
- Check if term is in a taxonomy?
- Hook to change Custom Tag Taxonomy Links?
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- Metabox to list/store a certain type of post tag
- Sorting Tags by Slug Value
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- How to filter a post in the Tag Cloud widget, using tags of a media library image attached to the post?
- Replace taxonomy permalinks
- Front-End Custom Taxonomy Tag Select
- get_terms not returning any custom taxonomies
- Create custom taxonomy and Display in metabox dropdown
- Problem with removing post tags programmatically
- Display formatted list of taxonomy terms with last seperator different
- How to get custom category’s link?
- saving meta/custom field to tag
- Changing input type from text to multi select dropdown – skill taxonomy
- How to call a custom taxonomy term name inside a function?
- Displaying user selected custom tags/taxonomies on the front-end
- Update Post Taxonomy Automatically Based On Date
- Featured Images for Tags?
- Taxonomy archive template not working
- Running a function only once when a taxonomy term is changed
- Displaying the post count of all custom taxonomy terms in a list format
- Automatically tag posts based on user-defined words [closed]
- making an index from custom taxonomies and tags of posts (not hierarchical taxonomy)
- Set two terms for a post when they differ only by an accent
- CPT tags not showing when editing post
- Get tags name under custom taxonomy in wordpress
- Filter Tags for current users
- Limit Tag Links in Post Content
- Change the Page Title of the Archive Page for Portfolio Tags
- How to add meta fields to custom taxonomy add/edit page?
- Using wp_tag_cloud with only current post tag with special class
- WordPress shortcode Issue!
- Automatically Populate Post Taxonomy Data Based on Post Author Meta Data?
- Get Posts by tag from a custom taxonomy
- Display the first tag assigned to a post
- Display custom post taxonomies
- Where to put code to get custom taxonomy term id?
- Function code problem
- How to randomise a custom taxonomy tag cloud
- How do i change the tags and taxonomies
- Any way to make custom taxonomy field searchable?
- How to get tags with custom taxonomy field?
- Primary Taxonomy for Post
- I’ve got a function that auto creates taxonomy terms – Can it auto delete them as well?
- Group custom taxonomies based on tags contained in their posts
- how to loop through blog posts in php
- custom texonomy category child category list with parent head
- Remove Tag Cloud Words from Custom Taxonomy
- Trying to list custom categories in custom post type [closed]
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Woocommerce – how to get and display selected variations on single product page
- How to add/enqueue Custom CSS for a custom taxonomy page?
- get_the_terms inside save_post gives old terms
- How do I change the Go To Categories link in the term_updated_messages
- wp_get_object_terms count on taxonomies within an category archive
- Adding new terms to custom taxonomy
- List posts grouped by children of a custom taxonomy
- Guest author – URL, base and custom taxonomy – working but unstable
- Bulk set Post Title as Tag where Tag is Empty Function
- Make custom post type display with custom taxonomy in url
- Hook to filter based on form value and insert term
- Change get_author_posts_url / Author URL via filter
- Display terms on product page with shotrcode
- add_rewrite_rule pagination 404 error on page 4 and above
- Search and filter with custom field in taxonomy
- Prevent random entries in hierarchical false taxonomies
- Exporting CSV of users with custom user taxonomies out of WordPress
- How do I create a term for every value of a post meta?
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post
- The search doesn’t work properly
- Pagination links not working for custom taxonomy
- Custom taxonomy archive empty
- Taxonomy to display form after creation
- How home my code doesn’t display any feature image? Looping through post from a taxonomy and not getting feature images back
- Taxonomy Child Not Updating Unless I Click Update Twice