Home>Support>All pages have been duplicated

All pages have been duplicated

By Konsti, 9 years ago. Last reply by Daniel, 9 years ago.

To whom it may concern,

After installing the premium version of the Vantage theme some of the pages have been duplicated for not reason rising the total count from 50 to 8000. However this only happened with two pages where I was testing the functionality of the Ninja Announcements widget. Please find below the analysis of our datamanager. (There are some screen shots that I unfortunately cannot include).

I had a look at the database and there is table called “wp_2_posts”, it seems the hold posts + pages (+revisions).

I executed a query to see which posts where duplicated:

SELECT post_title, post_name, post_date, post_modified, guid, post_type, count(post_title) as cnt
FROM `wp-multisite`.wp_2_posts
GROUP BY post_title
ORDER BY cnt desc

Here are posts that have more than 10 duplicates (see excel attachement) :
The “cnt” holds the count of duplicates.

post_title
post_name
cnt
post_date
post_modified
post_type
guid
Beausaert Simon
beausaert-simon
3536
29-03-2015 16:45
17-04-2015 13:36
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=302
Career prospects
career-prospects
851
26-03-2015 17:26
17-04-2015 13:23
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=22
Testimonials
testimonials
34
26-03-2015 17:27
28-03-2015 17:00
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=24
33
26-03-2015 11:37
26-03-2015 11:37
nav_menu_item
http://sbesrv0010.unimaas.nl/wp/mol/?p=9
Staff
staff
31
26-03-2015 17:21
15-04-2015 09:59
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=12
Contact
contact
15
26-03-2015 17:22
30-03-2015 11:31
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=14
Alumni
alumni
15
26-03-2015 17:41
17-04-2015 12:12
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=49
Programme information
programme-information
11
26-03-2015 17:20
28-03-2015 16:47
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=10
Course descriptions
course-descriptions
11
26-03-2015 17:26
29-03-2015 08:19
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=18
Photo gallery
photo-gallery
11
29-03-2015 15:01
17-04-2015 12:56
page
http://sbesrv0010.unimaas.nl/wp/mol/?page_id=274

Most posts/pages seem to be stored more than 1 time, not sure why (revisions?) and if that is normal.
The only 2 pages that are a problem are “Career prospects” + “Beausaert Simon” (Draft)

There are several tables in wordpress :

The ones that start with “wp_2_” belong to your site. I don’t know if I could just delete the pages in table “wp_2_posts” and not break anything (most databases have related foreign key fields in other tables). I believe there is meta-data somewhere else that will get orphaned.

Here is another query I did:

SELECT ID, post_title, post_status, post_name, post_type, post_parent, post_date, post_modified, post_author
FROM `wp-multisite`.wp_2_posts
WHERE post_title = ‘Career prospects’

Shows all “Career prospects” pages:

The original is the one with ID 22. Then some revisions, and the duplicates start at 408 (and go on until ID 1248)

I believe I could delete the dupes like this :
DELETE * FROM wp_2_posts
WHERE ID >= 408 AND ID <= 1248

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 5 months ago Konsti

    Do you what happened and if can safely remove these entries in table “posts” or is there related data elsewhere what also need to be removed. I would like to know which tables to look in, even better if you send me a delete query.

  2. 9 years, 5 months ago Daniel
    Hi, I Work Here

    Hi Konsti

    Records in wp_posts with a post_type = ‘page’ are the pages. You could give this plugin a run (https://wordpress.org/plugins/delete-duplicate-data/)

    As a rule of thumb, ensure you have a complete backup of your site, so that you always have something to roll back to just incase you make an error.

    Cheers

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More