Bulk editing of drupal meta tags. What are meta tags in Drupal and where to look for them. Metatag: Mobile & UI Adjustments - information for mobile platforms

When making websites on an engine, you will install at least a new theme and almost certainly a couple of modules. We all want the site to be convenient, beautiful, and useful. Novice website makers don’t even realize that there are things that are not noticeable from the outside, but are very important for the full life of a website. I'm talking about the CEO. You can read more about SEO. If in two in the words of the CEO this is what will help you get visitors to your site from search engines. Most of the SEO tasks for internal optimization are taken care of by the Meta Tags module. I would call it the most SEO module of all modules. I want to warn you right away, if you don’t know anything about meta tags, then it’s better to read it first. There's nothing complicated about setting up Meta Tags, but if you don't have an understanding of why it's done the way it is, it will be useless knowledge.

To edit the Canonical URL, click on Advanced. In the expanded block we will find a field with the desired name. In my case, the token for the Canonical URL was already selected by Drupal. This token suits me, so I won’t change anything. In addition to the canonical address, there are several more interesting items in the Advanced block, for example Robots. By marking various items in Robots, you can close the entire page or just the links on it from indexing, or you can, on the contrary, open it.

This completes the configuration of the MetaTags module for content. Then you can continue on your own. For example, set description and keywords for home page- Global: Front page.
It may happen that you want to configure MetaTags for a specific content type or dictionary in order to block it from indexing or for some other reason. Nothing could be simpler. Click Add a meta tag default. In the drop-down list, select the desired content type or dictionary.

Click Add_and_configure and proceed to configuration.

After completing all settings, check the result. It's easy to do. Go to any page on your site and press ctrl+u. it will be revealed to you source pages. Find the line there . If everything is in order, go to Configuration → Search and metadata → url aliases and find the system address of our article there. In my case it's node/2. Click on the link with the system address and press ctrl+u again. The canonical url must be the same as in the first case.

Canonical URL helps us get rid of most of the duplicates in the search engine index, and in a place with the correct robots.txt they don’t leave duplicates a single chance. At the same time, you need to remember that the stronger the product, the more carefully you need to use it.

Search Engine Optimization (SEO) typically comes first when designing and developing a website. There was a time when using the meta tag could help you achieve top rankings in search engines. Although this is no longer the case, meta tags are still available to search engines and can be useful.

In this article, we will learn how to install the Meta Tags module, which allows you to easily add meta tags to any content on your Drupal site.

If you're using drupal 6 with the Nodewords module, it's worth noting that the meta tags module is a much better replacement.

Meta Tags and Drupal

If you look at the source code of a node in Drupal, the meta tags will look like this:

Depending on the type of Drupal page, you may see different variations of this list of meta tags, but they all perform the same task of providing information about the page search engine. When installing the meta tags module, the number of meta tags will increase. For example, if you are creating an article, you can add keywords and description meta tags:

Pay attention to three additional meta tags: keywords, abstract and description.

Let's install the Meta tags module and see how to work with it.

Activation of the Meta Tags module

The following modules are required for installation:

  • Meta tags
  • CTools
  • Token

You will see that the Meta Tags module comes with additional modules that can be turned on or off depending on the needs of your site.

After installation, the Meta Tags module has its default settings, which can be overridden:

  • In the meta tag module, click on Add a default meta tag (I added the Portfolio type as an example)
  • Add token to the Annotation field
  • Save changes

When creating an article from now on, the meta abstract tag will appear:

Pay attention to inheritance in Meta Tags

The added article type appears under the content node:

You may have noticed that by default for the new type, tokens were included in the meta tags for the added content type. This is because they have been inherited, but you can still easily override them.

For example, you can place a token in the field of the abstract meta tag, and in the description field. There are other tokens, you can select them below in the View available tokens item.

Now let's add content to see how the fields for adding meta tags will appear for the newly created Portfolio type. Add material, scroll down the page and in the left column click on the Meta tags tab.

Here we see the token we added in the abstract field. All fields presented here can be edited.

You do not need to enter data for these fields each time; the token module does this for you. Its settings were described above. However, when creating material, you can always insert your own text instead of tokens.

Taxonomy terms and users in the Meta Tags module

The process of creating meta tags for these types is similar to that described above. As you already know, users can add a dictionary of terms for a tag field, but they do not have the ability to add meta data for a taxonomy term. This should be kept in mind when planning to work with users using the meta tag module.

Access and permissions in Meta Tags

Permissions for the Meta Tags module are simple. You can manage them, edit them if you have permission to change nodes, terms, and so on. You can also give users the ability to change meta data.

or how to set up a CMS yourself using a tutorial

In general, let's start by continuing the last lesson, where we downloaded and installed modules or extensions, as I sometimes call them. And for those who only
I’m now involved in the Drupal learning process, I highly recommend taking it
in practice past lesson. If you know what we are talking about, now is the time
continue and go to system settings. But according to tradition, first a short one
theory. We will configure the CMS so that our website has everything it needs
for work and was competitive when
the matter will concern his promotion,
that is, SEO. I think you won't mind.

Let's move on to the settings of Drupal version 7

Now let's go through the previous lesson, namely, the settings of Drupal modules.

In the control panel, in the Modules menu, enable Global Redirect:

There, in the panel for Rules and SEO, I noted the following parameters:

Meta tags were marked as follows:

Under the OTHER heading, enable the remaining extensions and save the settings at the very bottom.

Please note that opposite each module there is a link to its settings. It's not hard to guess what it's called. You can access the extension settings in another way - through the drop-down menu in the admin panel:

The admin panel was modified in the last lesson and now we have quick access to all of its items, which is very useful for those who are just starting to learn Drupal. We'll go through the settings of some modules in detail in subsequent chapters, but for now let's look at creating a sitemap.

1. Under the XML SITEMAP heading, include everything except the XML sitemap internationalization item. Using any of the two methods listed above, open the settings of the sitemap generator - XML ​​sitemap. Next in the settings, in the SEARCH ENGINES tab

We note that every time a new publication appears, our site map is sent for indexing to the Google and Bing search engines; save the settings:

2. Next in the extension settings

We make basic settings. For example, to change the priority of an article when indexed by search engines from 0.5 (default) to 0.8 or 1, click on Article:


and we get to the article settings page, where we go to the XML sitemap tab, enable the parameter, indicate the priority and save the type of material:

We return to the map settings, open Content and see that the priority has changed. So go through all the parameters yourself and don’t forget to save the settings at the bottom.

Drupal meta tag settings

Above we enabled the meta tags module and now we will analyze its settings for further work.

In the administrative menu, open Configuration → Meta tags:

Let's look at the structure of the main header, which is inside the HTML tags , using the content as an example. In the picture below you can see that by default the page title consists of the title of the post itself and the site title at the end:

For SEO, such a structure is not necessary. Click Override and remove the second half:

After changing the settings, click Save. As a result, when publishing articles and pages, everything remained the same for me: after the title comes the name of the site. Apparently we need the meta tags module for something else. By the way, when adding pages (Basic page), they are not displayed on the main page, unless, of course, you check the corresponding item in the settings when publishing:

We've sorted out the pages! For those who do not understand everything, I recommend watching the lesson page by page.

But we still need to resolve the issue of post titles. Let's look further.

Setting Headers in Drupal

In the Drupal site control panel, open Configuration, select Search and metadata, then Page Titles. All of this is located in your admin menu (i.e. control panel), provided you have completed my previous Drupal tutorials and installed and activated the appropriate modules.

So, open Page Titles for editing and remove the second half of the title:

This is what we got: Save the settings below.

When we add new content again, it will only have its title.

We will continue to get acquainted with the settings of published materials. Ahead of us is editing URLs. You will learn how to write your own custom URL for each individual article, plus manipulation of the already familiar title inside HTML tags - it turns out that it can also be independent and different from the one we write in the editor when adding new content.

Drupal configuration of logs, errors and states

Let's start with the development settings, go to Logs and Errors:

Once you have enough experience working with Drupal and your site is getting traffic, disable error messages so that if something happens, visitors don't see notifications:

Everything is clear, let's move forward! Let's see what state the site is in:


in the panel that opens we see the state of the system and the site itself. This is where you should go if you suspect that your site is somehow not working correctly.

In an upcoming lesson, you will learn how to set permissions for users. Your attention is required!

From the author: in fact, search robots are “blind”! They don't have the eyes to read your site's content and appreciate it. They perceive the value of only a few markup fields. Because of this, even a high-quality publication can remain out of sight of the target public. That’s why it’s so important to be able to set Drupal meta tags correctly!

With my own hand!

Many specialized modules have been created to work with SEO. But not all of them function as they should. Based on my own experience, I can say that hand-made search engine optimization will never let you down. In the admin panel, go to “Content” and select the desired one in the publications table.

Then at the end of the line with the name of the material, click on the “Change” link.

Then we go below the window text editor and find the “Tags” field. Here you need to enter the keywords by which the search engine will index your page.

The title of the publication is entered at the top in the editor. But this is not the title that search crawlers are looking for. Let's prove it. To do this, open the web page markup in the editor. And what we see. It doesn’t even smell like a “cloud” of tags here.

By default, Drupal inserts the name of the domain on which the site “hangs” there. For me it runs on a local server, hence localhost. So what to do about it? Where to insert description?

Good because it's simple

A simple Simple Meta module helped me solve the problem. It works at the local level. After installing it, go to the desired page, click on the “Meta” link, fill in all meta fields and save.

To check the correctness of its operation, open it again HTML pages in the browser, and observe the specified keywords, title.

Hello, blog site readers! The meaning of Title and meta tags Description and Keywords for search engine promotion the site is difficult to overestimate. By default, Drupal generates the Title automatically from the main title of the material; there is no ability to set the Description and Keywords meta tags at all. Such miscalculations from an SEO point of view are unacceptable. Today I will talk about two modules, Page Title and Metatags Quick, that allow you to solve this problem.

This article discusses only the technical side of the issue. As for the rules for forming Description, Keywords and Title Drupal from an SEO point of view, I dedicated this topic. I strongly recommend that you familiarize yourself with it.

Title setting in Drupal - Page Title module

Now, when creating a material, a new field is available to us, which is responsible for generating the Title in Drupal.

Setting up Keywords and Description in Drupal - Metatags Quick module

Install the Metatags Quick module in Drupal and activate it (we don’t need the Extra functionality and Upgrade from nodewords components).

Go to the section “Configuration” - “Search and metadata” - “Meta tags (quick) settings”. Here is a list of all available meta tags.

In addition to the especially important Description and Keywords, there are also optional ones:

  • Canonical URL - allows you to set the main address of the page. If there are several pages on the site with the same content, but different URLs, then the main one will be considered the one whose address is indicated in the “Canonical URL” meta tag.
  • Copyright (Copyright) - we provide a link to our website to show authorship.
  • Robots - allows you to allow or disable indexing of individual pages of the site.

We include meta tags for Materials and . Each meta tag will create a separate field for itself.

For example, go to “Structure” - “Types of materials” - “Article” - “Manage fields”. New fields for meta tags have already been created there. In my case, these are (Meta)Description and (Meta)Keywords. You can edit the output order for convenience.

We do the same for all types of materials and taxonomy terms.

The Metatags Quick module has an Extra functionality subsystem, which is responsible for automatically generating meta tags based on the page content. I will not specifically consider it so that you will not be tempted to use it. Title, Keywords and Description in Drupal must be set manually for each page! So don't be lazy.

Description and Keywords for the main page

And everything is fine in the Metatags Quick module, but it does not specify Description and Keywords for the main page. An annoying mistake that should be corrected on your own. Go to the server in the directory with the active one and open the template.php file for editing.

At the very end we insert the following code:

function TOPIC NAME_page_alter($page ) ( $meta_description = array ( "#type" => "html_tag" , "#tag" => "meta" , "#attributes" => array ( "name" => "description" , " content" => "Meta Description Tag Text") ) ; $meta_keywords = array ( "#type" => "html_tag" , "#tag" => "meta" , "#attributes" => array ( "name" => "keywords" , "content" => "Keywords separated by commas") ) ; drupal_add_html_head( $meta_keywords, "meta_keywords" ) ; drupal_add_html_head( $meta_description, "meta_description" ) ; )

In the code, indicate the name of your theme and description, keywords suitable for the main page of your site. Save the template.php file after making changes.

Removing the Generator meta tag

The Generator meta tag is automatically generated by Drupal. It contains information about the current version of the system and provides a link to the drupal.org website. This is bad both from a security point of view and from the point of view of search engine promotion of the site. Let's delete it.

We log into the server using , go to the /includes directory and open the common.inc file for editing. It is best to do this in the editor, as it highlights the code syntax and makes working with it more convenient. Find and delete the following code:

// Show Drupal and the major version number in the META GENERATOR tag.// Get the major version. list($version, ) = explode(".", VERSION); $elements [ "system_meta_generator" ] = array ( "#type" => "html_tag" , "#tag" => "meta" , "#attributes" => array ( "name" => "Generator" , "content" => "Drupal " . $version . " (http://drupal.org)" , ) , ) ; // Also send the generator in the HTTP header.$elements [ "system_meta_generator" ] [ "#attached" ] [ "drupal_add_http_header" ] = array ( "X-Generator" , $elements [ "system_meta_generator" ] [ "#attributes" ] [ "content" ] ) ; return $elements ;

Save the file after making changes. The Generator meta tag should disappear. Check it.