Title: Checking if Header Exists
Last modified: February 16, 2019

---

# Checking if Header Exists

 *  [OthelloBloke](https://wordpress.org/support/users/othellobloke/)
 * (@othellobloke)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/checking-if-header-exists/)
 * I’m trying to create a function that checks if headers exist and then sets them
   if it doesn’t.
 * I know ‘header_remove(“X-Powered-By”);’ exists for instance.
 * But does anyone know if there’s something like ‘header_exists(“X-Powered-By”);’?
   Or a way to check if a function has been set already?

Viewing 1 replies (of 1 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 3 months ago](https://wordpress.org/support/topic/checking-if-header-exists/#post-11213395)
 * [http://php.net/manual/en/function.getallheaders.php](http://php.net/manual/en/function.getallheaders.php)
   or this [https://www.w3schools.com/php/func_http_headers_list.asp](https://www.w3schools.com/php/func_http_headers_list.asp)

Viewing 1 replies (of 1 total)

The topic ‘Checking if Header Exists’ is closed to new replies.

## Tags

 * [headers](https://wordpress.org/support/topic-tag/headers/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/checking-if-header-exists/#post-11213395)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
