Skip to content

Non-production environments should not allow indexing by default #370

@jerico

Description

@jerico

Suggested fix

$default_config['seo']['index'] = Altis\get_environment_type() === 'production';
// ...
if ( get_config()['seo']['index'] ?? false ) {
    add_filter( 'robots_txt', function ( $text ) {
        $text .= "User-agent: *\nDisallow: /\n";
        return $text;
    } );
}

Came from: https://github.com/humanmade/terraform-app-stack/issues/1484

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions