Skip to content

Instantly share code, notes, and snippets.

@janboddez
Created August 11, 2023 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janboddez/9bcec95c18a50d9de0503f2f6afa5e6c to your computer and use it in GitHub Desktop.
Save janboddez/9bcec95c18a50d9de0503f2f6afa5e6c to your computer and use it in GitHub Desktop.
<?php
add_filter( 'robots_txt', function( $output, $public ) {
$output = str_replace( 'Sitemap:', "User-agent: GPTBot\nDisallow: /\n\nSitemap:", $output );
return $output;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment