Hello,
ACF Extended developer here ??
I am sliding into this thread as you mentioned my plugin. I’ll try to answer your question the best I can.
The first thing that needs clarification is what you mean by “I deleted the field from the admin board, but it still shows at the product pages”. In fact, that sentence can mean different things.
Let’s say you created an ACF “Text” Field, and decided to display it on the Post Type “Product” in the WordPress Admin. Then you edited dozens of Products, and entered a value in that “Text” field in the Admin. On the front-end, you then displayed that “Text” field using a custom code like get_field('my_field')
.
Now you want to “Delete that custom field but it still shows at the product pages”. That could mean different things:
– You deleted the “Text” field from the ACF Field Group Admin, but that ACF “Text” field is still present in the Product Admin UI.
– Or: You deleted the “Text” field from the ACF Field Group Admin, the field has been correctly removed from the Product Admin UI, but the value is still displayed on the front-end product pages.
In the first case, that probably means that you have some local json or local PHP field group definition somewhere in your theme. I would suggest to take a look at the /acf-json/
folder in your theme folder or search for any acf_add_local_field_group
code in your theme files.
In the second case, it means that you still have the code that display the value in your Product Templates. You should head over your product template file in your theme, and delete the ACF code that display the value. Probably a code similar to get_field('my_field')
or the_field('my_field')
.
To stay on the second case, one thing you have to understand is that ACF never delete meta value that have been saved in the database (there are very few exceptions to this rule, but it isn’t relevant in this discussion). It means that when you delete a Field from the ACF Field Group UI, it will simply remove the Field Input that can be edited by the admin from being displayed in the Admin. The meta value that have been saved in the past will remain in the database. There’s some valid reasons as of why ACF act this way, and every other plugins out there acts the same.
So as I suggested, the first thing to do is to simply remove the code that display the value in your front-end templates files. If you want to cleanup your database, then it is a different story. You have different solutions for that specific case. You can either head over your PHPMyAdmin UI to manage your database and manually delete post_meta
entries there. Or, as someone suggested, use ACF Extended which let you delete meta values directly from your Post Admin.
I hope it’s now more clear.
Have a nice day!
Regards.