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
- Get plugin directory from a theme
- WordPress Plugin Development In MVC Architecture, How?
- category_name not working (not showing up in sql query debug)
- What happens when two plugins have the same 3rd party class included into them?
- add_rewrite_rule, plugin activation and plugin deactivation
- Custom admin column disappearing when using Quick Edit [duplicate]
- Create page when plugin is activated
- Allowing Custom Capability to Manage Plugin Options
- wp_insert_user – how to send verification email before logging in
- Custom plugin settings: clicking “save changes” does not display success message
- How to un-attach rich text editor from named textarea elements
- How can I translate the name of my Plugin for other languages?
- How to load a new template page according to a particular URL?
- Getting User email on logout. wp_logout
- How can I filter blog name?
- Logs to check when the plugin was first installed for the first time
- How to get custom field image url of specific size
- Can a plugin add to header/footer/body content?
- Detect if a plugin was included in a certain page
- Override the core function locate_template
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Set user ID at time of wp_create_user
- How do I add a custom sub menu menu under Woo-commerce marketing?
- How to create custom tables in WordPress using my own plugin?
- How would I go about creating a user ranked post popularity page?
- How to modify WCMP Rest API response?
- Making a Template for a CPT created by a plugin
- Woocommerce dependent plugin
- External CSS in WordPress Plugin [closed]
- User Session and Stored Cookies not get removed
- get 404 when accessing wp-admin/plugin-install.php
- Woocommerce Minimum Price for a Composite Product to add in cart
- Customised plugin failed to install and activate
- Plugin Development Form Self Submission
- Why is one phpunit test throwing an error on one class when all other classes are similar without error?
- How To Extend A WordPress Plugin Without Losing Your Changes [duplicate]
- Does a blank plugin come with any overhead?
- WPDB: Update table
- Why is my custom post type not being activated on plug-in activation?
- How to get all posts belongs to a user between a certain date
- Check filter defined or not?
- How to remove bulk actions from custom post type
- How to generate an all in one WordPress New content, plugin and theme update report on a website? [closed]
- License validate function
- wp_enqueue_style on template_redirect level?
- Built a second plugin but it overwrote the first one
- Symlink a plugin in local development, works but got Debug error message – Windows 10
- Display my plugins content based on a pages post_id
- Custom Post Type template for homepage
- Pluging with content for a specific page or post
- How can i export and import my plugin option WordPress
- Remove all messages, when untrash a post
- Upload Image with a file URL and show dynamically on Frontend
- Why won’t wp_enqueue_script work within any plugin file?
- How can i solve php upgrade problem
- How to resolve warning for `unstableOnSplit` prop on a DOM element in block editor
- Rename a folder via HTML POST request
- how override a define
- WordPress plugin blog creation
- Preserving existing functionality converting HTML to WordPress
- add tags to wordpress post using REST API
- path of wp-content directory when we are on some plugin
- how to do Thematic like this website using wordpress?
- Add Custom Field to Post Pages via Plugin
- Timing issue with is_amp_endpoint()
- Can I add content before post content without using the_content filter
- Why is the WordPress update_option not working in this code?
- what is the best way to create a premium plugin while also protecting your code
- hide load more button if there are no posts left to display
- Add predefined values to custom post plugin
- Input gets deleted/overwritten after changing to different Admin Menu
- How to set the default options on an existing plugin in a WP MU new user install
- Plugin Breaking WordPress Login
- Cannot Search | Featured | Popular | Newest | Favorites in wordpress working
- How can I use multi Media Uploader in a plugin?
- Is it possible to run javascript on plugin deactivated?
- Gutenberg: Dynamic Block – Show saved data in the editor
- How to fix ‘Call to undefined function do_settings()’ error?
- Suitable hook when creating, updating and deleting posts programmatically
- How to be Variables and options must be escaped when echo’d?
- How to override plugin function in code snippets WordPress
- How can I gather forums posted by visitors from different sites in one place? [duplicate]
- How to make content as required in custom post type?
- How to create a “Most Popular” & “Latest” TAB in WordPress