Tell us what you are trying to do? I want to display a relationship box fields in the post editor with only one value. Right now, the same value is displayed multiple times.
What is the link to your site? hidden link
Hi,
Thank you for contacting us and I'd be happy to assist.
To troubleshoot this, I'll need to see how this relationship and the field are set up in the admin area.
Can you please share temporary admin login details in reply to this message?
Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.
regards,
Waqar
Thank you for sharing the admin access.
I can see the issue of repeating custom field values in the relationship box section on your website, but I couldn't reproduce this on my test website. This suggests that something specific to your website is involved.
To troubleshoot this, I'll suggest the following steps:
1. Please make sure that WordPress, active theme, and plugins are all updated to the latest versions.
2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.
If it's fixed, you can start adding the disabled items, one by one, to narrow down to a possible conflicting one.
3. In case the issue still persists, I'll need your permission to download a clone/snapshot of the website, to investigate this on a different server.
I hope this helps and let me know how it goes.
1. Please make sure that WordPress, active theme, and plugins are all updated to the latest versions.
Done, still not working as expected.
2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.
Done, still not working as expected. I disactivated every other party plugin one after the other and set the theme to Twnety Twenty-One.
Related fields are still displaying the same value mulitple times. hidden link.
3. In case the issue still persists, I'll need your permission to download a clone/snapshot of the website, to investigate this on a different server.
You have my permisson. THANKS!
Thanks for the update and the permission.
I've downloaded the duplicator package from the website and currently performing some tests.
Will share the findings, as soon as this testing completes. Thank you for your patience.
Just wanted to let you know that I'm still working on this and will share the findings, within the next few hours.
Thank you for waiting, while I completed this investigation.
It turns out duplicate records exist for the custom field values in the database, which is why they are also showing as repeated in the relationship meta box.
Had you performed any import of the content specifically for the custom field data?
To remove the repeated/duplicated custom field records, you can run some SQL queries on the database, using a tool like phpMyAdmin, as explained in this guide:
hidden link
For example, to remove the duplicated records for the custom field with key 'wpcf-annee-numero' from all the posts on the website, the SQL query will look like this:
delete from wp_postmeta
where meta_id in (
select *
from (
select meta_id
from wp_postmeta a
where a.meta_key = 'wpcf-annee-numero'
and meta_id not in (
select min(meta_id)
from wp_postmeta b
where b.post_id = a.post_id
and b.meta_key = 'wpcf-annee-numero'
)
) as x
);
Similarly, you can repeat the same for any other custom field key too.
I hope this helps and please let me know if you need any further assistance around this.