Skip Navigation

[Resolved] Avoid duplicated posts

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to validate the custom fields in admin and avoid the duplicate posts

Solution:
You need to use standard WordPress hook save_post in order to validate your custom field.

You can find the proposed possible solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/avoid-duplicated-posts/#post-618180

Relevant Documentation:

This support ticket is created 6 years, 9 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Daniel 6 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#617697

Hi,

I am building a directory of translators associations. I intend to created several hundreds of posts with information like e-mail, site url, name etc.

I am afraid that administrators or guests users might repeat the same association. Is it possible to create a warning or alert when someone submits the same information?

For example: when someone introduces a URL that coincides with the field in another post, that an error alert comes up.

Thanks for your help
Daniel

#617812

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I would like to confirm here - you want to validate the duplicate field on admin section while adding or creating new posts or using CRED form?

#618039

NO. I want to avoid that duplicated posts are created.

Let's say I create a new post and insert a link (in a URL field) that matches with a link in another post of the same CPT, so that URL would be repeated.

Is it possible to avoid the creation of a post that contains exactly the same field in another post of the same type?

Thanks

#618180

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - you need to use standard WordPress hook save_post in order to validate your custom field.

But it needs some custom programming which is beyond the scope of our support policy. If you need custom programming for your project, please feel free to contact our certified partners:
=> https://toolset.com/contractors/

Still - you should check following link that may help you:
=> https://stackoverflow.com/a/23902916

#618194

Great. Thanks for the information.