Filter the value of an existing option in WordPress

/**
 * Filters the value of the admin email.
 *
 * @see https://wpcodebook.com/wordpress-filter-option-value/
 * @see https://github.com/WordPress/wordpress-develop/blob/6.6.2/src/wp-includes/option.php#L247
 * @see https://developer.wordpress.org/reference/functions/get_option/
 */
add_filter( 'option_' . 'admin_email', function ( $value ) {
	return 'admin@example.com';
}, PHP_INT_MAX );

Commonly-used options:

admin_email
blogname
blogdescription
blog_charset
date_format
default_category
home
posts_per_page
posts_per_rss
siteurl
template
start_of_week
upload_path
users_can_register

Leave a Comment