Why is wp_redirect() preferable to a standard PHP header redirect?

See the source. It has some additional logic for IIS servers, as well as some hooks. It is also pluggable function, so it might be redefined.

Overall it’s just more flexible and gives other developers more options to work with your code, unavailable if you just hardcode things.

Leave a Comment