How to change all 404 to 410 error code in WordPress
If you want to change all 404 error of your WordPress website into 410 error statues then just add this code before the get_header(); in you 404.php template Hope it helps. Reference: stackoverflow.com