Advertisement
pusatdata

Remove custom fields from WordPress database using SQL

Mar 17th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Step 1
  2. Login to your hosting account and launch myPHPadmin from the cPanel, or equivalent, to access the WordPress database engine.
  3.  
  4. Step 2
  5. Enter a select SQL command to list all the meta keys you want to remove. In this example, I want to find and eventually remove the meta key dcssb_short_url.
  6.  
  7. SELECT * FROM 'wp_postmeta' where 'meta_key' = 'dcssb_short_url'
  8. Step 3
  9. Once you are satisfied you’ve narrowed down the selection, issue a delete SQL command to remove the rogue data
  10.  
  11. DELETE * FROM 'wp-postmeta' WHERE 'meta_key' = 'dcssb_short_url'
  12. Step 4
  13. Issue the same select SQL command again, to verify all the offending records have been deleted.
  14.  
  15. SELECT * FROM 'wp_postmeta' where 'meta_key' = 'dcssb_short_url'
  16. If you get no results returned, it means that you successfully deleted the records.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement