Tell WordPress and plugins whether a site is production, staging, development or local, so they can behave differently.
// One of: 'production', 'staging', 'development', 'local'.
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
Staging sites should never send real emails, ping search engines or take payments. WordPress has a built-in way to say which kind of site this is, and many plugins and snippets check it.
wp_get_environment_type() returns the value of WP_ENVIRONMENT_TYPE, or 'production' when it isn’t set. Code can then check it, for example if ( 'production' !== wp_get_environment_type() ) { … }.
WordPress itself treats 'local' and 'development' as development sites, and Site Health shows the value.
Go to Tools → Site Health → Info → WordPress Constants. WP_ENVIRONMENT_TYPE should show your value.