Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to delete a custom field (in the sense of complete removal from WP database) without using a plugin?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If you have access to phpMyAdmin, these steps should do the trick:

Step 1: Login to your hosting account and launch myPHPadmin from the cPanel, or equivalent, to access the WordPress database engine.

Step 2: 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.

SELECT * FROM 'wp_postmeta' where 'meta_key' = 'dcssb_short_url'

Step 3: Once you are satisfied you’ve narrowed down the selection, issue a delete SQL command to remove the rogue data

DELETE * FROM 'wp-postmeta' WHERE 'meta_key' = 'dcssb_short_url'

Step 4: Issue the same select SQL command again, to verify all the offending records have been deleted.

SELECT * FROM 'wp_postmeta' where 'meta_key' = 'dcssb_short_url'

If you get no results returned, it means that you successfully deleted the records.

Source

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.