451 Unavailable For Legal Reasons
Tags: webdev, testing, beginners
Published: 2020-08-21 23:41:11

## What is a 451 Unavailable For Legal Reasons HTTP response?

Usage of the 451 HTTP status response code is suitable for situations where a resource must be blocked for legal reasons, such as where a court judgement or law requires that content should be made unavailable.

451 has been used widely by US news/media sites following the introduction of EU ‘GDPR’ privacy regulations, blocking content for EU visitors.

The 451 HTTP status was actually only introduced quite recently in 2016 – in order to provide more information than previous alternatives such as 403 forbidden.

## What type of HTTP status is a 451?

A 451 is in the 4xx class of status codes which are client error based.

## Example 451 response

`451 Unavailable For Legal Reasons`

![Example of a 451 HTTP response shown to EU website users](https://dev-to-uploads.s3.amazonaws.com/i/gl0dwuievpmgomqvyd6h.png)

Example of a 451 HTTP response shown to EU website users

![Example 451 response in the Chrome network tab](https://dev-to-uploads.s3.amazonaws.com/i/2hgkuirf19le0nmq4ejm.png)

Example 451 response in the Chrome network tab

## When should a 451 response be used?

A 451 response is suitable for any situation whereby a court or other legal entity has mandated that a web resource must be removed or blocked.

Examples might include: criminal court cases, civil court cases, tribunals, statutes/laws, treaties, or simply a request from a company legal department.

A 451 response does not necessarily have to be served globally. For example many US news sites show a 451 status and message to European users to get around GDPR privacy requirements.

## Does a 451 HTTP status affect SEO?

If you want to block all users for legal reasons – then a 451 code is perfect – and will also likely remove your site from search engines.

If Google are unable to access a resource it is likely that they will not index it. If all users/bots that attempt to access a resource are served with a 451 response and no content, it will not be indexed.

However from testing conducted at the time of writing: if US users and Googlebot are able to access the content then this content will be indexable/potentially available in Google search.

## Specification

```
This status code indicates that the server is denying access to the resource as a consequence of a legal demand.

The server in question might not be an origin server.  This type of legal demand typically most directly affects the operations of ISPs and search engines.

Responses using this status code SHOULD include an explanation, in the response body, of the details of the legal demand: the party making it, the applicable legislation or regulation, and what classes of person and resource it applies to.  For example:

HTTP/1.1 451 Unavailable For Legal Reasons
Link: <https://spqr.example.org/legislatione>; rel="blocked-by"
Content-Type: text/html
<html>
<head><title>Unavailable For Legal Reasons</title></head>
<body>
<h1>Unavailable For Legal Reasons</h1>
<p>This request may not be serviced in the Roman Province of Judea due to the Lex Julia Majestatis, which disallows access to resources hosted on servers deemed to be operated by the People's Front of Judea.</p>
</body>
</html>

The use of the 451 status code implies neither the existence nor nonexistence of the resource named in the request.  That is to say, it is possible that if the legal demands were removed, a request for the resource still might not succeed.

Note that in many cases clients can still access the denied resource by using technical countermeasures such as a VPN or the Tor network.

A 451 response is cacheable by default, i.e., unless otherwise indicated by the method definition or explicit cache controls; see [RFC7234].
```

### RFC

<a href="https://tools.ietf.org/html/rfc7725">RFC 7725</a>

### Title

An HTTP Status Code to Report Legal Obstacles

### Date

February 2016

If you want to check out more status code research and definitions check my <a href="https://www.searchcandy.uk/seo/seo-glossary/http-451/">SEO glossary here</a>.