This project is not covered by Drupal’s security advisory policy.

Content AI is an powerful module that utilizes the OpenAI platform to generate top-notch content easily. In its recent version, it offers the ability to create SEO content, including titles, keywords, and meta descriptions, as well as facilitate article and page translations in a streamlined and effective manner.

Dependencies

It is important to consider the activation for the modules below before start Content AI usage:

Previous Configuration

Before starting to use the Content AI module and all the features it provides, some configurations are recommended:

OpenAI

The OpenAI module is a key component in the functioning of the Content AI module. It is through OpenAI that the connection to the API is established using a key, enabling all the features of Content AI to work properly.

After installing and activating the OpenAI module, in the directory yoursite/admin/config/openai/settings, the API Key should be inserted. The API Key, in turn, can be obtained at this link.

Setting API Key for OpenAI module

Metatag

With the Metatag module, it will be possible to specify the fields that will automatically receive SEO content in articles and pages through the Content AI module. With the Metatag module installed, go to the directory yoursite/admin/config/search/metatag, click on the Content option, and then click on the Edit button. In the Basic tags section, check the presence of the Page title, Description, and Keywords fields. These are the fields that will automatically receive information from the Content AI module in articles and pages (note that no action is required on this page, accessing it is recommended only to check the presence of the mentioned fields (Page title, Description, and Keywords)).

Metatag defaults configuration

Metatag options

In the directory yoursite/admin/config/search/metatag/settings, open the options Content: Article and Content: Basic page, and select only Basic tags from the list of options in both sections. At the end of the page, click on the Save configuration button.

Metatag initial configuration

With the meta tags set up, the structures of the articles and pages must be modified so that the fields referring to the meta tags are displayed in the configuration options and can receive information from the Content AI module later on. To do this, you need to access the directory yoursite/admin/structure/types and then click on the Manage fields button for the Article option first.

Content options page

The list of available fields for creating an article will be displayed. Click on the Add field button to add a new field as specified below.

Available fields for articles

Description

  • Type: Meta tags
  • Label: Description
  • Machine name (generated automatically from label): field_description

Click on the Save and continue button. On the next page, simply click on the Save field settings button.

Adding Description field

Finishing Description field configuration

Go back to the directory yoursite/admin/structure/types/manage/article/fields and check for the presence of the new field Description.

New field configured for articles

In the directory yoursite/admin/structure/types, the same field Description can be provided for content of type Basic page. To do this, simply click on the Manage fields button.

Content options page

After accessing the settings page for Basic page, click on the Add field button.

Available fields for basic page

On the settings page for the new Basic page field, select the option Meta tags: field_description under Re-use an existing field, and enter Description for Label, as shown in the image below. Click the Save and continue button to finish, and on the next page, click the Save settings button.

Adding Description field

Save settings

With all the settings completed, the new field Description will be available for Basic page content types.

Finished configuration for basic page

Workflows

Through the Workflow module, provided by default by Drupal, it is possible to specify the flow so that contents such as articles and pages can be saved as drafts or published, for example. In the context of the Content AI module, Workflows, together with the Content Moderation module, work to prevent translations generated by Translate AI from being immediately published after generation, allowing for a review of the generated content before publication.

In the directory yoursite/admin/config/workflow/workflows, delete any available workflows generated automatically by the Workflows module installation on the page (if any workflow has been already created before make sure that the settings will not to affect the configuration suggested below), and then click on the Add workflow button.

Adding a new workflow

Provide a label (Draft Option, for example), then select Content moderation for Workflow type and click on the Save button.

To configure, go to the This workflow applies to section and click the Select button of Content types, and select the option All content types (Article and Basic page will be selected). To finish, click the Save button in the window and, finally, click the Save button on the Workflow settings page.

Workflow configuration section

Selecting content types to workflow

Finishing workflow configuration

Languages

To provide languages for the translation feature available in the Content AI module, you can access the directory yoursite/admin/config/regional/language. In this directory, simply click on the Add language button, select the desired language on the next page, and then click on the Add language button again. After this process, the language will be available for translating articles and pages using the Content AI translation feature.

Available languages

Selected language

New language available

After the above settings have been made, it is expected that the features of the Content AI module will be properly available for use.

SEO content generation

The available settings for automatic generation of meta tags in articles and pages can be accessed through the directory yoursite/admin/config/contentai/settings:

Content AI settings

The fields shown in the image above have their functionalities described below:

  • Option: this determines the type of meta tag information that will be generated automatically with the support of GPT. The initial options available include Title, Keywords, and Description. Other fields may receive information automatically, but for this, programmatic intervention in the module is required.
  • Model: this refers to the version of GPT that will be used for generating the content. Currently, text-babbage-001, text-curie-001, and text-davinci-003 are available, but more versions may be added in the future;
  • Temperature: this setting controls the tone of the content that is automatically generated. You can adjust it to make the tone more serious or friendly, depending on your needs;
  • Meta tag field selector: this setting determines the ID of the field that will receive the automatically generated content for an option (Title, Keyword, or Description). For example, the field that will receive the automatically generated content for the title is #edit-field-description-0-basic-title on the article creation page;
  • Question: this is the question that will be asked to GPT to generate the title, keywords, description, or other information automatically. In the question, the shortcode {body} is used to represent the text of the article, so the question will also be asked considering this text.

Some suggestions for the settings of the topics above are listed below:

  • Option: Title
  • Model: text-davinci-003
  • Temperature: 1
  • Meta tag field selector: #edit-field-description-0-basic-title
  • Question: Could you generate a title from the following text? "{body}".
  • Option: Keywords
  • Model: text-davinci-003
  • Temperature: 1
  • Meta tag field selector: #edit-field-description-0-basic-keywords
  • Question: Generate keywords from the following text? "{body}". Separate the result with comma and space.
  • Option: Description
  • Model: text-davinci-003
  • Temperature: 1
  • Meta tag field selector: #edit-field-description-0-basic-description
  • Question: Generate a meta description with a maximum of 160 characters from the following text? "{body}"

Once you have configured the settings, you can simply go to the article edit page (yoursite/node/node-number/edit) and select one or more options in the Meta Content AI section (Description, Title, or Keywords). Click on the Generate button, and the content will be automatically generated based on the settings you have specified, as well as the article text. Note that it is necessary for the body field to already have text and this text to be saved in the database, as this text will be used as the basis for the automatic generation of meta tags.

Meta Content AI section inside article configuration

The generated content will be inserted into the Page title, Description, and Keywords fields under Basic tags in the Description section. You can find the Meta Content AI and Description sections in the right column of the article edit page.

Content automatically generated inside Basic tags section

After publishing and saving the content, the texts generated for the meta tags through the Content AI module will be available in the article or page code:

Meta tag Description

Meta tag Keywords

Meta tag Title

Translation

The translation feature available in the Content AI module can be accessed through any article or page in the Translate AI tab in editing mode. It is only necessary for the article or page to be saved in the database, regardless of the state of this content (Draft or Published).

Meta tag Title

To translate the article or page, simply select the desired language(s) and click the Translate button. Please note that the translation time will depend on the number of selected languages, so it is highly recommended not to select too many languages for translation at the same time. This will avoid overloading the API requests and reduce the chances of possible errors in the tool's functionality.

Language selected

After a few moments, the translation will be available. Note that the translated article or page is provided with the status Unpublished to prevent the translation from going directly to the website and to allow a review of the generated content before publication. If the content is appropriate, simply click on the Edit button of the translated article or page and change the status from Draft to Published.

Translation done

Status changed for translation

Status updated for translation

Supporting organizations: 

Project information

Releases