Skip Navigation

[Resolved] Custom type post value displays in view filter twice

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by Beda 4 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#1521453
After deleting value.png
Before deleting value.png

I am trying to:

I have a custom type called "Locations". One post has a location called "St. Charles County". However, this value seems to be getting displayed twice and it is the only post type with this value.

Even after trying to delete this value from the post type, it still displays in the view filter.

Link to a page where the issue can be seen: hidden link

I expected to see: Only once instance of "St. Charles County" in the location filter and no instances of it when the value is deleted from the post type.

Instead, I got: Two instances of "St. Charles County". If I delete the value "St. Charles County" for the post type that has it, I expect to see no instances of it displayed.

Is it possible for me to manually delete this value on the backend to stop it from being displayed twice?

#1522471

Once its value="St. Charles County", and once value=" St. Charles County"
So there is a second value with space before the name, somewhere

Interestingly both come from the same post hidden link

I see that's a repeating field and it's likely that some attempt to save failed, then a re-attempted save succeeded, but the data was duplicated.
Maybe you imported posts and added the fields with an import? This is a common source for such issues.

You can check in the database wether the post (by ID) has two of those fields. Then delete one of them (likely, though, you will not find it).
Instead, you would have to look in the database for the exact slug of that field (wpcf-job-location presumably) and find those that have NO post ID assigned. There should be one at least, the unexpected one in the filter.

Also, I suggest updating Toolset, to ensure to have no outdated software.

Please let me know if after this the issues persist.

#1525241

Hi,

Thank you for your help. I did not import posts and add the fields with an import. Like you mention, I saw that one of the values was " St. Charles County" and should have been "St. Charles County", so I tried to edit it the post as an admin and change this value. This caused the data to duplicate.

How do I look in the database for the exact slug of that field (wpcf-job-location presumably) and find those that have NO post ID assigned? Is this something I do within the WordPress Admin? Can you provide steps to do this?

Thank you.

#1526523

This requires you to have access to phpMyAdmin or something similar to handle your WordPress database.
Then in the database find and remove that entry.
This is something maybe your cPanel host provides, it depends from install to install.
There are also plugins letting you edit the database:
https://wordpress.org/plugins/wp-phpmyadmin-extension/

It is always dangerous to edit the database directly, so a backup of it is mandatory before you proceed.

Please be careful and sure that what you remove is really what you want to remove, have a backup ready to replace in case something goes wrong.

I'd like to extend my offer to do this for you (the edit of the database) after you perform a backup, as it is at least related to Toolset, and it is not an expected issue or something that should even be necessary to be done.
I can help with it if you want

I enabled private replied in case you want me to log in and check this.
I'll need to have access to the database for this.

#1529101

Thank you very much for your help. I really appreciate your offer to do this for me, but when I spoke with my web hosting provider and it seems like the MySQL service is not accessible from FTP. To make any changes to the database, they said you would need specific access to the MySQL service - which cPanel locks down to localhost access only by default.

However, they said they would be able to do it for me and it seems like my cPanel install has phpMyAdmin. Would it be possible for you to give me instructions to locate the data entry (perhaps post ID or whatever other information they might need to find the entry)? I am not familiar with phpMyAdmin so I am not sure what information they would need. I am not sure if it will be difficult for you to provide these instructions without access.

#1530155

That's right, you can't access MySQL from FTP.
FTP are files that run your installation like WordPress and then it talks to the database, which is the MySQL part, which if you want to access it directly, you need some PHP MyAdmin or similar software.

cPanel provides that usually, any host should let you access your database, or provide means to access it.

If your host is doing this or a developer, they need to know that an entry in the postmeta table with name LIKE St. Charles County is appearing probably twice, and at least one of those entries should have no "post_id" entry (that's a column in the postmeta table)

That entry should be removed.
These instructions should help anyone familiar with MySQL and WordPress databases:
https://toolset.com/forums/topic/custom-type-post-value-displays-in-view-filter-twice/#post-1522471

Hence if your host offers to do this I'd suggest those steps.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.