Updating records

All the existing tables contain a pre-built update method for updating existing records. The following list illustrates a few of the built-in update functions:

update_post_meta This creates or updates additional details about posts in the wp_postmeta table. Accepts post ID, key, and value as parameters.
wp_update_term This updates existing terms in the wp_terms table. Accepts term ID and taxonomy as parameters.
update_user_meta This updates user meta details in the wp_usermeta table based on the user ID. Accepts user ID, key, and value as parameters.

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.