Drupal

Block bots from search pages using Cloudflare

In the past several months many sites have seen massive traffic spikes from AI bots. This has lead to overloaded web servers, inflated web hosting costs, and negative effects for legitimate traffic.

Sites using a CDN can block some of this unwanted traffic relatively easy, once you know how.

Here's how I blocked bots using Cloudflare:

Tags: 

Debugging why a block doesn't display

Recently I was tying myself in knots trying to work out why certain blocks weren't displaying. Long story short, the problem ended up coming from a custom condition plugin that didn't cover for enough use cases.

I ended up tracking down the problem by debugging my way through the block condition logic. In BlockRepository::getVisibleBlocksPerRegion() it checks the access logic for each block

Tags: 

Grouping Simple Sitemap by content type

The XML sitemap standard has been around for almost 20 years and serves as a great way of keeping Google and other search engines up to date on what content is changing on a website. Thanks to the world of open source, sites which use Drupal have tools to automatically generate the files based upon the site's content, e.g. Simple Sitemap, instead of having to manually create them.

Tags: 

Pages

Subscribe to Drupal