Skip to content

Instantly share code, notes, and snippets.

@rileypaulsen
Last active December 19, 2015 13:09
Show Gist options
  • Save rileypaulsen/5960565 to your computer and use it in GitHub Desktop.
Save rileypaulsen/5960565 to your computer and use it in GitHub Desktop.
retroactively add custom fields to existing posts
insert into wp_postmeta (post_id, meta_key, meta_value) select ID, '###FIELDNAME###', '1' from wp_posts WHERE post_type = '###POSTTYPE###'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment