The second approach (joining additional table) is better for several reasons.
- When plugin is not active, you won’t retrieve it’s data (or with other words, you won’t select additional data unless you explicitly join it)
- It’s more maintainable. You can alter your plugin table without altering posts table and vice versa.
- The join most likely won’t hurt performance, but may improve it if there are a lot of updates – (one more post on the same topic)
Related Posts:
- Delete tables from database when deleting plugin
- How can I delete orphan keys in WordPress database tables?
- How to delete all records from or empty a custom database table?
- Using Vagrant for customizable WordPress Multi-sites [closed]
- clean wp_options table unused rows
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Integrating Custom Database with WordPress
- Pull Data from DB for Admin Page Display as Relates to Admin Page Class by BA Internet
- Posts are deleted everyday at night
- How to implement a customizable free OpenID authentication?
- Difference between add_filter and apply_filters
- What are these entries in the database? Looks similar to JSON
- Creating Unique Post URLs for A/B Testing… Is this even possible?
- How to delete the Hello Dolly plugin automatically?
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- Open external links in a new window
- How can I limit functionality in one version of a plugin?
- How to add usermeta to “Notice of Email Change” email message
- Any way to use a custom Parameter for youtube embed without using an iframe?
- Custom database table for plugin not creating on activation
- WordPress 3.1 and Disqus throws Warning: number_format() error in Posts List
- Should I global $wpdb outside of any of my plugin’s functions scope?
- How can I rewrite a plugin generated URL?
- How to edit/delete single row items in a table on my own menu page
- Leveraging WordPress Comments on Custom Plugin Object page
- Debugging Technique Question re: functions.php
- Is there a way to alter the order in which the plugins appear in the page?
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- FacetWP group listings by custom field [closed]
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- How to embed HTML code from WP Coder plugin (or other) into Main Index Template of the theme
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Remove Duplicator plugin from admin menu if not an administrator
- Doubt using $wpbd->get_col for a single column
- Add a custom form on the post-new.php admin page
- Edit Yoast SEO breadcrumbs output [closed]
- WordPress Settings Lost After Site Migration
- className not populating in custom block
- In the archive widget, how do I sort in between two years?
- import posts with dutch/special letters
- Fromcraft Plugin On click submit button [closed]
- creating a custom shop page display on archive woocommerce
- polylang + category/tag custom language link
- How to redirect users to their profile after they successfully edit their profile
- How to create multiple database tables on plugin activation?
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- Creating Featured Content Boxes
- Customizing Titles on the Fly with Code
- Best/Correct way to add an option to a category
- Loop in elementor custom widget not working
- Historical customisations won’t go away [closed]
- DB Query not working in Plugin
- .php file for woocommerce edit category? [closed]
- Where do plugin variables live in the db?
- Plugin: connect to external database without showing password
- Storing Form data in a different database
- How to display an alert when deleting a plugin?
- More than one WordPress site using the same database – how to disable plugin for one site?
- unregister a sidebar widget
- How to disable Wp-PageNavi at the top of the page
- 404 errors when updating options in admin dashboard
- Display WordPress comments before the plugins?
- Mobilepress fails to translate short codes
- woocommerce remove coupon link does not work
- Getting infinite scrolling working on my custom template
- What database state changes happen after a post is manually “updated” with no changes?
- Display posts by alphabetical order
- Can i stream data to a custom_post_type?
- How do I add a medium to the WordPress database with my own plugin?
- Precheck fields when I add a new post
- Get Shortcode output to database for static post_content
- My wp database has been hacked
- How to update a database entry with a wordpress plugin?
- Custom wp_list_tables redirect on specfic page
- Paid Membership Pro displaying a user name in PHP
- How can I store user preferences in WordPress and retreive them later?
- Automatically check “Enable stock management at product level” to the existing products?
- Creating Nested custom fields
- one admin for 2 wordpress websites
- Need help for creating custom table on wordpress
- Plugin does not create a custom table upon activation
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Plugin program: JQuery not working in this plugin
- Get page type to display content
- Insert data in custom table during new post creation
- How to fix vanilla comments extra iframe space
- How to submit the custom form data in database in WordPress without plugin?
- Duplicator live to wamp https to http
- Woocommerce quick checkout form [closed]
- Is it possible to recover Deleted users?
- How to add image for custom taxonomy
- Social network plugins for WordPress [closed]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- Wrapping code in an if block
- How can I properly sanitize the update_option in WordPress?
- Form with response button after on table after submission
- Product customizing quiz – quiz adding products to the cart
- How to make a Template page to show the information of different things Shop and Product page?
- Can’t save formdata in DB