After removing a site, nothing happens - "Removing the site. Please wait..."

This happens almost every time if I remember right. I finally decided to report it, though it’s not really a big deal.

When I go to delete a website from MainWP, I open the site itself to its dashboard and then use the Settings page and click the Remove button. This works fine as the site does get removed at some point, but the problem is the page doesn’t update live, it doesn’t refresh or take me to another page or show a confirmation popup when finished.

Instead there is just this at the top of the page:

It doesn’t stop spinning and eventually I just leave the page and go back to the main dashboard and the site will be gone.

I don’t know if this is a bug report or a feature request. I suppose the expected behavior would be that some sort of popup comes up smack in the middle of the page that tells me the site is being removed (not just a dynamic message that appears at the top of the page which I can’t even see if I don’t scroll all the way up first). And then once it’s removed, it should auto-refresh back to the main Sites dashboard or previous filter/search page where another popup comes up confirming the site was removed. That’s what would make sense to me.

If there were some sort of error removing the site, then the popup would say that and the site page would just stay open. But if it’s successful it would auto-refresh back to the main page somewhere.

I know you might ask me for details but it’s an ongoing thing and I don’t have any sites to delete right now. The screenshot above was taken probably before the last few MainWP updates so maybe this issue has already been worked on. I’m just hoping it’s a functionality that can be improved simply because it needs it. I can’t really provide any more specifics.

Thanks!

This bug (it is a bug) exists for years now. I’ve reported it as well, but they couldn’t reproduce and it’s hard to debug, because we don’t want to remove sites we want to keep.

Sometimes a site can be deleted just fine and you go back to tge list of sites.

So there’s a step in the process that deletes data from the database or someting, that fails and stops the process without the proper checks. My best guess is something related to old sites (with deprecated data/settings) or with certain extensions in use.

The whole process should be checked and possibly failing steps should be caught and not block/hang/kill the process prematurely.

Ya that makes sense.

I would prefer a rewrite and use popups and such. Maybe if they rewrite the logic the bug would get squashed.

I’m investigating the code at the moment to see where it can hang the removal process and it looks like it happens at one of the following steps:

  • do_action( 'mainwp_delete_site', $website )
  • do_action( 'mainwp_site_deleted', $website )

But 5 extensions I’ve checked that hook into these actions (Sucuri, SSL Monitor, Staging, UpdraftPlus and Wordfence) only perform simple DB queries and no show stoppers are expected there.

So I’m going back to MainWP core steps and have already found some suspicious timeout related steps.

I’ll post an update as soon as I have more information!

I’ve used Claude AI to help investigate a code and it looks like a timeout of 20 hours combined with a missing .fail() handler could be causing this issue.

I’ve posted my report on:

Hey @zackw and @josklever

That is correct, we couldn’t reproduce this on our multiple test Dashboards.

We will take a look at the report @josklever made in the new thread, and we will take another look at the issue.

I’ll update you once I have more info on it.

It could have a ton of causes, but if it’s related to some kind of ping back from the site-to-be-removed, maybe that’s part of it? All my sites run one or both of Solid Security and Sucuri Security, but I also use many hosts. Maybe there is a ping being blocked and that’s all it is?

When a site is disconnected, is it trying to talk to the website first? Perform actions on it? And if so, is there code to continue the deletion even if it can’t talk to the site properly?

To my recollection, I’ve had sites where the end user up and moved it, some developer or agency changed DNS or hosting and cut me off completely. When deleting a site like this, it hands no different than deleting a site that shouldn’t have any comms problems at all.

Hopefully you find something to make it more robust!

A fix for this issue was included in version 6.1.6 of the MainWP Dashboard released today.

Thanks again for reporting this to us.