To add a status code 410 to Drupal for deleted content, you can follow these steps:
- Install the "Redirect" module in Drupal. This module will allow you to create redirects for deleted content and specify the HTTP status code.
- After installing the module, go to the "Configuration" page in Drupal and select "URL redirects."
- Click on the "Add redirect" button to create a new redirect.
- In the "Source URL" field, enter the URL of the deleted content that you want to redirect. For example, if the deleted content was at the URL "/node/123", enter "/node/123" in the field.
- In the "Redirect to" field, enter the URL that you want to redirect users to when they visit the deleted content. This can be a relevant page on your site or a custom page that explains why the content was removed.
- In the "Response status code" field, select "410 Gone" from the dropdown menu.
- Click the "Save" button to create the redirect.
By setting the response status code to 410, you are indicating to search engines that the content is permanently removed and should be removed from their index. This can help improve SEO by preventing users from finding dead links and reducing the number of pages that search engines have to crawl.