Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 4.10 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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: America/Los_Angeles (GMT-07:00)

This topic contains 9 replies, has 2 voices.

Last updated by Bobby 11 months, 1 week ago.

Assisted by: Bobby.

Author Posts
May 1, 2023 at 3:33 pm #13565673

jean-francoisS-2

I recently got an issue removing a language from my site: https://wpml.org/forums/topic/delete-an-existing-language-on-my-website/

The person helped me clean the database but there seem to be posts that still exists because sometimes I see the same post twice when I use the search function on my site. They have 2 different ID but one of them is not related to any language on my site.

Is there a query I could run to delete all these posts that arent related to the 2 langauges on my site?

May 2, 2023 at 6:46 pm #13573763

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

I would like to take a closer look at this to see where these duplicate pages are coming from.

Are you using the search function at the frontend or the backend of your site?

Share with me a search query if it's at the frontend so I can test this as well. Also feel free to share with me any screenshots you have of the results with the duplicated pages

May 3, 2023 at 8:32 pm #13581889

jean-francoisS-2

Are you using the search function at the frontend or the backend of your site?
At the front, it is using the_search_query()

Share with me a search query if it's at the frontend so I can test this as well.

This is the url: hidden link

post ids : 44644 and 44604

duplicate.PNG
May 4, 2023 at 7:18 pm #13589807

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you, I can see them now.

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

May 13, 2023 at 6:44 am #13639823

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for the access details!

Go to Posts->Categories-> Notice the categories are displayed twice.

Make sure to remove the duplicate category and test again

For example, I have removed RH et Business.

May 15, 2023 at 1:43 pm #13648539

jean-francoisS-2

Hi, after deleting the duplicated category on the live site, I still have the issue. I think none of the posts or page related to the removed language got deleted. For example here is a query with pages, product from woocommerce and posts duplicated : hidden link

May 17, 2023 at 4:21 am #13660195

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for updating me!

Please check this on the staging site, when I go to Articles->All articles -> French -> I can see certain articles showing twice.

For example the article Accélérer la mixité: entrevue avec Marie-Christine Mahéas was listed twice. Deleting the version not translated seems to have resolved this issue.

Screen Shot 2023-05-16 at 9.17.31 PM.png
May 17, 2023 at 7:33 pm #13667917

jean-francoisS-2

I have reset the staging with a fresh copy of the live site after deleting the copied categories.

I did see the duplicated posts but I notice one of them does not have a linked translation. I think these posts come from the fr-EU lang that was deleted. Also, after removing the categories. All these posts are not showing up in the admin, but still appear in the search.

Is there some kind of query I could run to delete all the posts that dont have translations? Or is there another way to fix this?

May 18, 2023 at 1:38 am #13668635

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Yes, this happened most likely after the custom language was removed.

Same to as if you had RESET WPML, the content would have it's language code info removed and it would display under the default language.

While it may sound tedious the best way to resolve this is to go to Posts->All posts-> French language and delete the ones that do not have a translation.

You can bulk-select them and delete them.

Please try this with a few and let me know your results. Afterward, they should not display in the search query twice.

In the meantime, I will discuss this with our team and see if theres a possible query that could help.

May 23, 2023 at 4:21 am #13694445

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

To add to my previous reply, I discussed this with our team and a SQL query for this type of issue would be quite dangerous as we could end up deleting the valid post rather than the duplicate.

Instead we suggest doing it using the bulk actions or with this plugin
https://wordpress.org/plugins/remove-duplicate-posts/

The topic ‘[Closed] Delete post not related to languages’ is closed to new replies.