I bought an auctioned domain to build my new project, from my analysis with Ahrefs, people that were behind this domain had a subdomain called "forum" for their forum, and somehow they didn't know how to protect it so there's thousands of spam threads (pharmacy, drugs and so forth), and probably they deleted the subdomain afterwords, if Googlebot ever fetch those links, it'll receive 404, but I want to 410 the whole subdomain to deliberately say I deleted this subdomain, I know if I had 404 Googlebot will go back to it a few times until it count it as 410, but I really want to 410 if it's possible and I have no clue how to do that.
The main domain is built using WordPress and I have Yoast premium plugin. Server is Nginx with Siteground but I have no access to it. I tried .htaccess that's located inside the WordPress installation but I have no clue what to type in it exactly.
Last thing that is strange, all these subdomains URLs had thousands of thread spams: