How to add an IP address by custom header in iThemes Security

Questo articolo รจ stato scritto oltre 1 years, il contenuto potrebbe essere datato.

Sometimes happen that you are working on a specific hosting that has a specific architecture so the IP of the bruteforce in the log of iThemes Security have a strange IP address.

iThemes Security look on 3 specific header (cloudflare and standard ones) to find the real IP address but sometimes is not enough.

The plugin offer a specific filter where is possible to add a custom header name where look on it.

add_filter('itsec_filter_remote_addr_headers', function($headers) {
    $headers[] = 'X-Forwarded-For';
    return $headers;

With this little bit of code is possible to add the custom ones and have a real IP for the plugin and continue to work.

It is important for the plugin to identify the real IP in that way can block all the request and not consider all the request from a bad IP.



Liked it? Take a second to support Mte90 on Patreon!
Become a patron at Patreon!

Leave a Reply

Your email address will not be published. Required fields are marked *