Title: wp_http_accept_encoding
Published: April 25, 2014
Last modified: April 28, 2025

---

# apply_filters( ‘wp_http_accept_encoding’, string[] $type, string $url, array $args )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#wp--skip-link--target)

Filters the allowed encoding types.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#parameters)󠁿

 `$type`string[]

Array of what encoding types to accept and their priority values.

`$url`string

URL of the HTTP request.

`$args`array

HTTP request arguments.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#more-information)󠁿

Note that the filter function **must** return a $type value after it is finished
processing or the HTTP call will fail.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#source)󠁿

    ```php
    $type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-http-encoding.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-http-encoding.php#L184)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-http-encoding.php#L184-L184)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Http_Encoding::accept_encoding()](https://developer.wordpress.org/reference/classes/wp_http_encoding/accept_encoding/)`wp-includes/class-wp-http-encoding.php` |

What encoding types to accept and their priority values.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/?output_format=md#comment-content-4841)
 2.   [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  5 years ago  ](https://developer.wordpress.org/reference/hooks/wp_http_accept_encoding/#comment-4841)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_http_accept_encoding%2F%23comment-4841)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_http_accept_encoding%2F%23comment-4841)
 4. Example Migrated from Codex:
 5.     ```php
        add_filter( 'wp_http_accept_encoding', 'filter_function_name', 10, 3 );
    
        function filter_function_name( $type, $url, $args ) {
            // Write code below to alter available encoding types here
            return $type;
        }
    
        add_action( 'init', 'get_google_home' );
    
        function get_google_home() {
            $google = wp_remote_get( "http://google.com&quot; );
        }
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_http_accept_encoding%2F%3Freplytocom%3D4841%23feedback-editor-4841)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_http_accept_encoding%2F)
before being able to contribute a note or feedback.