I recently cleaned up a huge amount of spam comments and posts on someone's Wordpress website. Not just a few, but like over 500K worth of pages.
Now there is a huge spike in GSC/GA4 for the site's 404 page because these pages are gone. How do i properly validate that this was fixed and that these pages should be removed from the index and the site should work as normal? I can't redirect 500,000 pages
There is no inherent superiority between 410s and 404s, in my opinion. We've done tests on this before, and from what I've read, others have also done the same, and nobody has been able to find any difference.
That being said, if the pages still follow a specific pattern and there is no longer a crawl path to them, perhaps you might attempt the URL removal tool.
Although sitemaps are recommended, I've heard of people asking Google to continuously crawl these URLs, which will completely destroy your crawl budget.
https://wpclerks.com/wordpress-maintenance/