
How to Set up Automatic AI Content Moderation in Drupal? Modules and Examples
Artificial intelligence in content management systems enables the automation of publishing processes that previously required manual verification. By using the appropriate modules in Drupal, you can configure a system that automatically approves or rejects content based on predefined AI criteria. In this article, I will present a complete guide to configuring such a system, along with practical examples. Feel free to read the post or watch an episode of the Modern Drupal series.
In this article:
- Essential modules for automated moderation
- Configuring the Content Moderation module
- AI content moderation work in practice
- AI content moderation - summary
Essential modules for automated moderation
To demonstrate the functionality, I used a local installation of Drupal CMS, which allows for free testing and configuration without affecting the production environment. To create an automatic content moderation system in Drupal, you need to install several key modules. You will need the AI core and AI Automators modules, which form the basis for all artificial intelligence operations in the CMS system.
The next step is to choose an AI provider. In our example, we will use OpenAI, but you can configure other available providers according to your project's needs. This provider will be responsible for processing content and making decisions based on given prompts.
We will also need the Content Moderation module, which is a key component of the automatic content approval system. It allows you to manage content statuses and define new workflows from creation to publication.
The Base Field Override UI module is an essential part of the configuration. This module opens access to fields that are normally hidden from regular users in the standard Drupal interface.
Using Base Field Override UI to edit hidden fields
To use this module, go to the Structure, then to Content Type, and select any content type, for example, Event. After going to the Manage Fields section, you will see the Base Field Override tab. In this tab, you will find all fields that are not normally available for editing - these are fields from the BaseField Definition class. You can choose from fields such as Title, Created, Promote, and more.

You can modify not only the labels of these fields, but also their descriptions. As an example, we will use the Authored on field. You can add the word "test" at the end, changing the label to Authored on test.

After saving the changes and creating a new event, you will notice that the author field is now displayed with the new label Authored on test. This feature is particularly useful when customizing the editorial interface to your organization's specific needs and makes it easier for editors to understand the purpose of each field.
Configuring the Content Moderation module
To manage content statuses and implement AI moderation, you need the Content Moderation module. Its configuration in the presented example is based on the standard installation available in Drupal CMS, which provides a solid foundation for most implementations.
After installing the module, go to the Structure, then to Content Type, and select the content type for which you want to configure automated moderation – in this case, Blog Post. Then go to the Base Field Override section. I have prepared an override for the Moderation state field. This is where the content status – published or unpublished – will be set based on the content field.
Configuring AI Automator for the moderation state field
After entering the Moderation state base field edit, you will see the key Enable AI automator checkbox. Select the AI Automator Type and the appropriate configuration.

In the example, I used a simple prompt: "If there are political articles, set the value of this field, moderation state, to unpublished." The system also offers placeholders that make it easier to create more advanced rules.
An important feature is the ability to add new states in Content Moderation. Each newly created state will automatically appear in the options available to AI Automator, ensuring the system's flexibility.
Advanced settings
In Advanced Settings, you can configure:
- Trigger - when the automator should start (e.g., when editing content),
- Lookup - when the system should check the conditions.
An important part of the configuration is the store explanation option - a place where we store explanations from AI as to why a given article was not published or why it was published.
AI content moderation work in practice
The practical application of an automated moderation system is best illustrated with a specific example. Imagine a situation during an election period when you want to protect yourself from the publication of inappropriate content by editors acting under the influence of emotions. In the case of a typical programming blog, political content would be inappropriate for the audience.
Let's create a new blog post with political content and set it to the published state to see how the AI system reacts.

The result was immediate – even though we manually set the status to published, the system automatically changed it to unpublished. When we go to the article review section, we can see the explanation generated by the AI: "The text contains political content endorsing a specific candidate, which is not related to IT or programming."

In this simple way, in just a few minutes, we were able to create an effective filter to control what content the editorial team can publish. The AI system automatically checks each article against predefined criteria, eliminating the need for human moderation of obvious cases.
Prompt expansion possibilities
The prompt presented here is only a basic example of the system's capabilities. In the automator editor, you can create much more advanced rules, including:
- lists of prohibited words - specifying specific terms that disqualify content,
- thematic analysis - verifying compliance with the publication profile,
- tone control - checking whether the tone is appropriate for a given audience,
- comprehensibility assessment - verifying that the text is easy to understand,
- technical level analysis – checking whether the content is too technically advanced for readers
All these criteria can be defined in a single prompt, creating a comprehensive quality control system for published content. This flexibility makes the solution suitable for both simple personal blogs and complex websites with multiple levels of moderation.
AI content moderation - summary
Automatic content approval and rejection using AI in Drupal is a powerful tool that can significantly streamline editorial workflow. The combination of the AI Automators, Content Moderation, and Basefield Override UI modules allows you to create a flexible moderation process tailored to the specific needs of each project.
The example of political content filtering presented here can be easily adapted to other applications, creating a comprehensive system for controlling the quality of published content. The key to success is careful configuration of AI prompts and the use of the ability to store explanations of content moderation decisions.
If you want to implement a similar automation system in your Drupal project, take advantage of our experience. We offer comprehensive support in implementing AI solutions in content management systems as part of Drupal development.