WP_FAIL2BAN_HTTP_HOST

Override the hostname used for logging.

Default setting: disabled


Forces WPf2b to use a specific hostname for logging instead of the detected HTTP host.

This setting was introduced as a workaround for older syslog implementations with very short limits on the identifier: a shorter hostname kept the default wordpress(host) identifier within that limit. For this case, prefer WP_FAIL2BAN_SYSLOG_INLINE_HOST, which moves the hostname into the human-readable message and leaves a short, stable identifier.

The override remains available when logging needs to use a fixed hostname for another reason.

Example: Set specific hostname
/**
 * Override HTTP host detection
 */
define('WP_FAIL2BAN_HTTP_HOST', 'example.com');

Note

This affects logging only; it does not change WordPress’s behaviour.

History

Added in version 3.0.0.