If you’re not going to use those plugins, have at it. No reason to keep them around. Direct SQL query should be fine.
Related: add_post_meta()
has a nifty argument to prevent this very problem. The fourth argument is a boolean, declaring whether the meta should be singular:
add_post_meta( $post->ID, 'my_foo_bar', 'value', true );
Source: Add Post Meta | WP Codex
Related Posts:
- How to add a custom field in the advanced menu properties?
- Underscores in custom fields
- Sortable Custom Columns in User Panel (users.php)?
- Add custom field to the archive page?
- How to rename a custom field?
- Adding Custom Field to Taxonomy Input :Panel
- Unable to get Preview of Uploaded image within a Custom Meta box
- How to activate “custom fields” section in WP3
- How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API
- Add meta data to the menu
- Custom bulk action for media gallery items
- Copy SEO Meta Desc “Custom Field” to Excerpt field?
- Custom fields won’t display on my blog page
- Order Custom post type loop by custom field (datepicker)
- Localized Date Format for Custom Field
- Check if the value of a field has changed on save_post
- How to edit multiple post with Custom fields
- Undefined index error when saving content on metabox
- Saving custom image meta fields
- Echo values from custom field outside loop php
- How to update custom user meta field in wp?
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Complex WP_User_Query call fails on production server
- Query post order by post and desc not working
- If category then echo a custom fields
- How can I show custom fields in the loop only to specific user roles?
- Add conditional custom option to ‘Display name publicly as’ dropdown
- Custom fields not getting saved in the databse when added to the add new user profile page
- Show 1 post and after a specific date show the next one
- How do I define post titles as images using Custom Fields?
- How to show Small Box Inside Content Area, which holds (text, images, links)?
- Sort custom field by post
- How to order posts by one custom field and filter them by another one?
- Can we create a WordPress read-only virtual field derived from three other fields?
- How to create a gallery custom field for WordPress post?
- How to display image inside container of custom made widget
- List users by sum of all their posts’ custom field values
- Custom Metabox additional item
- Display Custom Meta Box Field Only If Value is Present
- Am I overusing custom fields (for adding nearly 5 images and their titles)?
- WP Query – Is this correct?
- edit_tag_form_fields is depricated but tag_edit_form_fields doesn’t work
- Iterate through users and display users meta info at front-page
- How to remove custom fields from the selector?
- What is the proper way to add a required field to a post type? [duplicate]
- Getting the Featured image URL and inserting it as Custom Field on Post update / publish
- Adding custom field and querying from post table
- How to display a product features dynamically with icons?
- Access ACF fields within custom preview function?
- Scripts and tags will not save or output from my custom meta box
- Using WP Color Picker in Repeatable Fields
- Update custom field values on edit address page woocommerce
- How do I save Multiple fields in a meta box?
- Can I access Posts of custom-fields via URL?
- Output custom field value
- Is there a (sane) way to get all custom fields for a post, which do not have a leading underscore?
- Custom field image to Featured Image
- Best way to achieve multiple links in a post title
- Show array of meta_value in Edit Post Coloum
- plugin-list-category-post custom fields
- How to display data from custom fields I created?
- custom filed from post in the side bar
- Working with multiple values and metaboxes
- Unable to select image with custom field
- How to automatically change a posts status to draft based on custom field
- Rewrite comment form post ID on submit
- How to show ACF fields in Gridbuilder custom block
- Move the metaboxes to the very top of post editor
- WordPress Rest API custom field not updating till i manually update the post
- search based on custom field
- Why isn’t update_post_meta saving?
- Custom fields multiple commas separated values
- Display taxonomy loop using custom field data
- Adding more fields to the registration form
- Add custom field information to source meta data
- use mysql to replace one custom field value with another custom field value
- Change blog post title on main blog page
- Spit out list of distinct instances of custom field?
- How to save array option as text and not integer?
- Delete custom meta
- Filter and display a specific custom field value [closed]
- Is it possible in WordPress
- Custom fields are not displaying in page with multiple loops
- Add class from custom field into widget class
- Edit different parts of a page seperately
- Get multiple posts with some custom fields efficient
- I want my post to republish again after adding a custom field
- Adding custom field to Lightbox in header only pulls current page data, not Lightbox item data
- Meta boxes not displayed, data isn’t being saved
- Custom fields / meta box output
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- Get single image from custom fields made with WCK custom fields creator
- Media Custom Fields – get a value with PHP
- How to add google map to custom field
- jaredatch metaboxes on video post formats
- Add CSS class to posts with certain meta key
- Best way for managing images of ads banners
- Crop custom image size vs actual size
- Multiple permalinks for a single post from custom field
- Search for meta_query does not return any result if combined with title