Lots of my clients use The Events Calendar plugin (TEC) because it’s the go-to events plugin for WordPress. That doesn’t mean it’s the best events plugin – just that it has the best marketing. One of the plugin’s downsides to TEC is that it fills your sites with URLs ending with /?tribe-bar-date=2026-05-10, ?ical=1 and more. URLs that tend to bypass the page cache and therefore consume CPU resource and hurt page-load performance.
If you run a single website and you never crawl it with SEO tools, you might not notice this. But if your site has 20+ events on it, and you crawl it with Screaming Frog (or similar), you’ll see a ton of non-canonical URLs suffixed with calendar-related query parameters.
There’s not much you can do to fight robots that ignore robots.txt, but for “good” bots such as GoogleBot and BingBot, we can make a small change to robots.txt to drastically speed up site crawl time. This helps your SEO because you’re not swamping the crawler with tons of non-canonical URLs.
In your WordPress site’s child theme, edit your functions.php file and add the following snippet:
/**
* Append The Events Calendar (TEC) crawler-trap Disallow rules to robots.txt.
*
* The `robots_txt` filter only runs for WordPress's *virtual* robots.txt.
* If a real `robots.txt` file exists in the web root, the filter is bypassed
* and these rules will not appear. After install, fetch `/robots.txt` over
* HTTP and confirm the Headwall comment block is present.
*
* @param string $output The robots.txt content WordPress has built so far.
* @param bool $public Value of the `blog_public` option — true when the
* site is visible to search engines.
* @return string The (possibly extended) robots.txt content.
*/
function headwall_tec_robots_txt( $output, $public ) {
if ( ! $public ) {
// The site is not public, no action required.
} elseif ( ! class_exists( 'Tribe__Events__Main' ) ) {
// TEC plugin is not active, no action required.
} else {
$rules = array(
'/*?ical=', // ...
'/*&ical=',
'/*?outlook-ical=',
'/*&outlook-ical=',
'/*?tribe-bar-date=',
'/*&tribe-bar-date=',
'/*?eventDisplay=',
'/*&eventDisplay=',
);
$output .= "# The Events Calendar crawler-trap hardening\n";
foreach ( $rules as $rule ) {
$output .= sprintf( "Disallow: %s\n", $rule );
}
}
return $output;
}
add_filter( 'robots_txt', 'headwall_tec_robots_txt', 20, 2 );To check it’s working, navigate to your site’s robots file, e.g. https://example.com/robots.txt. If you don’t see the custom rules in there, check that the TEC plugin is activate, and check your site doesn’t have the “Discourage search engines from indexing this site” option ticked in Settings > Reading.
Once the custom rules are enabled, legitimate crawlers will be able to fully index your site in a fraction of the time, and all your canonical event URLs will stand out because the non-canonical noise will have gone. A nice easy SEO and performance win.
