Based on your comment:
when a user clicks to vote, i get the value of that post meta and check if the user id exists in that (using php explode and foreach). If it does not exist then i add the user id in it.
there’s no query involved there, so it’s perfectly fine to use post meta for that purpose.
A query would be something like “load all posts from database where user with ID n has voted”. That would be more difficult to achieve, as it’s a many-to-many relationship, which WordPress doesn’t do natively. Storing user IDs as serialized data (an array) is a PHP construct, MySQL doesn’t “understand” that data natively, so that would not be a good use of post meta.
Related Posts:
- Update Multiple Post Meta for the Same Post In One call?
- Updating post meta for custom post types
- How can I add a custom meta value on file upload?
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- How can I change the meta_key for a particular piece of information?
- Adding custom meta boxes to specified custom post type
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Remember the Meta Value With Radio Buttons
- Help to Create a Simple Plugin to make a post
- how to auto random increment for post view
- How to securely controlling data without keeping it in postmeta?
- “Enable Media Replace” plugin does not update serialized object in WPMeta
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- How to get post that has non zero or greater than zero meta value
- Delete postmeta when uninstall/delete plugin
- wordpress last all added get meta value by post id
- Does WP identify plugin by plugin name or plugin_basename?
- switched from query_posts to WP_query, not working now?
- Making a plugin only available on the front-end for the logged in super admin
- Create entire wordpress as a github repositery?
- Help With MySQL to WPDB Query Conversion
- When to load auto-login code?
- AJAX search posts and pages
- How to find the origin of a file upload from within wp_handle_upload?
- How would I go about creating a user ranked post popularity page?
- CSV file generation failing
- What is generating my meta og:description?
- Updating the Drag-To-Share eXtended share URLs?
- finding whether request is for post, and post id
- Building plugin with changeable custom post type values…advice needed
- How to get all of the activate_plugin action parameters?
- __callStatic method handler passed to add_action causes bug in PHP
- Enqueue WordPress plugin scripts below all other JS
- Display update notification messages like ‘What’s New’
- How to add Internationalization in WordPress using Javascript/React?
- CRUD and Frontend show from a custom table without shortcode
- How to get specific setting by settings_fields()?
- Save / Show multi line text in metabox
- Creating mySQL procedure with $wpdb
- how to disable blockrenderAppender inside all Innerblocks?
- why doesn’t this update part of this plugin work? it take me to nothing here page
- Redirection of users away from wp-admin (but not administrators)
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Using a custom plugin to capture input data via Ajax and PHP
- Python with wordpress plugin
- Display post lists in 2nd paragraph
- Map Custom Registration Fields to WordPress User Roles
- Not able to add option in Sub-Menu under page
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- How to apply a patch via plugin?
- Fixing WordPress’s Bug (failed to send buffer of zlib output compression) results in “White Screen of Death”
- Disable woocommerce cookies and delete cart data automatically
- Ajax contact form widget plugin data not insert in database
- How to display the “ratingValue” and “ratingCount” values generated by the KK Star Ratings plugin into my page’s recipe ld+json schema
- link bbpress forum discussion to blogposts
- Install Plugin via Code
- code is working properly in Core PHP but writing coding in WordPress
- Combine scripts from all extensions of the plugin when an extension is activated
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- Prevent duplicate records in plugin table
- Send Custom welcome email to specific user group
- woocommerce payment gateway callback not firing [closed]
- How to modify WCMP Rest API response?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- White page by using filter template_include
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Making a Template for a CPT created by a plugin
- Woocommerce dependent plugin
- WordPress.org Plugin Directory doesn’t recognise screenshots [closed]
- External CSS in WordPress Plugin [closed]
- How to check current user before all actions and filters?
- Owl Carousel2 image not displaying full width when using Stretch row and content, Stretch row and content(no padding) in wordpress
- User Session and Stored Cookies not get removed
- New databes tables with – WooCommerce – for developers [closed]
- How can I prevent my plugin go development trunk [closed]
- Plugin-generated pages use Not Found or Pages Archive templates?
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- creating html reusable blocks via shortcodes
- Add Plugin options as subpage to Theme options page
- Is there any kind of theme on WordPress to sell my own movies?
- Image upload and download from front-end
- get current date + 90 days and checking every day
- Create a navbar filter that filters by a custom field
- Change commission_status paid when withdraw_status vendor is completed
- Passing an array from shortcode-function to filter-function
- custom payment gateway in woocommerce failed to connect to remote api server
- wp_remote_get() returns 403 while file_get_contents() does not
- Single API call exposed via shortcode with params
- Plugin options page with live preview?
- Using SVN to upload plugin created with gutenberg blocks
- Force quit running background job
- Modifying Author Link to add Author Meta in URL
- How to output CMB2 select options from repeated groups select elements?
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- Get Time Taken By Each Action Hook in WordPress
- How to export post 2 posts WordPress plugin data [closed]
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- WordPress plugin creation how to execute .sql in order to insert multiple rows at activation of plugin