How to Fix Category and Comment Count After WordPress Import

In this article we’ll look at how to fix category and comment count after WordPress import. If you’ve imported a WordPress site using the built in importer, then you might see the wrong number of count on your comments or categories on your site.

The importer properly brought all that information over, but it’s just not showing. Let’s go through a few steps to get it back. First make sure you backup your site. We use BackupBuddy for that.

And next, add and copy this code from our article and paste it in a text editor file.

You want to replace the db_host, db_user, db_password with your WordPress information.

You can either find that by logging into your cpanel or by looking at your wp-config.php file in this folder location.

Now you need to Save the file as comments-fix.php.

And we can upload the file to your site’s root folder using an ftp client or using the cpanel’s file manager. Now that it’s uploaded to your site, visit the page like this. And you’ll see some information on the page.

The script loops through your posts, category, and everything else and updates the count. When you’re finished, make sure to delete this file from your server and now your site should have the proper counts again

Оставьте комментарий

Ваш адрес email не будет опубликован.