WordPress.org

Forums

[resolved] 43,000 categories to delete (11 posts)

  1. greenreflection
    Member
    Posted 1 year ago #

    We have been unable to get to our posts pages and edit posts for quite awhile. Finally by addressing some memory issues we can get to the pages, but there are still problems which seem to be memory based.

    I looked at the posts and there are thousands of categories that have the name '#' (a single hashtag. They each have a different number as a slug name. It seems to me that these thousands of categories are eating up tremendous memory and probably causing a bulk of our problems.

    I am only able to select and delete 10 of these at a time in the admin control panel and then the process takes at least a minute to complete.

    Is there another way to bulk delete these categories. I am aware that you can't just delete them from the database table since there are associations all throughout the installation from that table.

    This is a crazy place to be right now, so I need some really wonderfully sane answers to this conundrum! Thanks.

  2. domokun
    Member
    Posted 1 year ago #

    Wow, that's a lot of categories!

    For starters, you can goto Screen Options (in top right of screen) and choose to show more categories per page. I think 200 is maximum. Not great, but 20 times more efficient than what you're currently doing ;)

    Id also suggest looking into why or what is creating these categories. A plugin must be misbehaving.

    You may want to consider using (with caution) the Bulk Category plugin

  3. greenreflection
    Member
    Posted 1 year ago #

    Your points are definitely salient. Yes, I changed the number of categories per page (you can set up to 999 per page) but the process of deleting errors out at any more than 10 per page. And yes, looking into what created them in the first place is essential. Thanks for the suggestions. I'll take a look at Bulk Category plugin.

    I'm wondering if I need to set the maximum time out somewhere to avoid the gateway timeout?

  4. greenreflection
    Member
    Posted 1 year ago #

    Brain is waking up, and your comments and writing about this led to this question:

    Since the process in the Administrative panel works but times out, how might I set limits to prevent the gateway timeout?

  5. greenreflection
    Member
    Posted 1 year ago #

    Troubleshooting Worpress in the forum, I must say is an awareness building activity!

    I do believe that even though the delete categories action times out, that the process continues regardless. I set the number of categories to 100 and the process timed out. But on a refresh of the screen, it does appear, that slowly the number of categories is going down. So this is hopeful. The next step is that I will increase the number to 999 and see where that takes me. I'll report back regarding failure or success. Thanks.

  6. greenreflection
    Member
    Posted 1 year ago #

    Ok. It appears that with a higher number loaded that it will only delete 106 categories at a time, which is better than where I started.

    I've also asked my hosting provider to increase the maximum time setting.

    So not there yet, but slowly making progress

  7. domokun
    Member
    Posted 1 year ago #

    Good effort ;)

  8. greenreflection
    Member
    Posted 1 year ago #

    Thanks for the encouragement. It all started with a memory issue. Now I can see that the most likely a big part of the memory issue was this ridiculous number of categories that need to be read every time anything to do with a post is activated.

    And I am open to all suggestions as to how to help make what I am doing less cumbersome!

  9. greenreflection
    Member
    Posted 1 year ago #

    And thanks for the input. Its the only way I've been able to really make any progress. Getting input and feedback from people in these forums.

  10. greenreflection
    Member
    Posted 1 year ago #

    I asked support at my hosting provider to set the time limits to 10x higher

    they set them thus:
    '
    mysql.connect_timeout = 600
    max_input_time = 600
    default_socket_timeout = 600
    max_execution_time = 600
    '
    The result of this action is that I can now delete 240 categories at once. There is still a time out after 2 minutes; but after 15 minutes those 240 categories have been deleted. Still hoping to find a more efficient solution.

  11. greenreflection
    Member
    Posted 1 year ago #

    OK, I wanted to report back on where I ended up.

    By opening multiple tabs each tab having my admin panel with the categories window open, I was able in each window to delete 250 categories in each window. This added up to deleting 2000 at a session. At first I needed to wait 20 minutes for the process to take place. Over time, the deleting process was faster.

    I've now deleted the 41000 categories that needed eliminating.

    This freed up the memory that was needed to display posts in the editing window. I can now edit and see posts in my admin.

    Thanks again for all who helped me through this. It was a strange, long process. But its done now.

Topic Closed

This topic has been closed to new replies.

About this Topic