Last updated June 6, 2014. Created on June 6, 2014.
Edited by goldieashe, minneapolisdan. Log in to edit this page.

By default, users don't have control over the Alt text that gets used with their site logo. To write a custom Alt text for your logo, you need to do the following:

For Drupal 8

  1. Start with a copy of your theme's page.html.twig file to edit
  2. Locate the following section of code to edit
    {% if logo %}
          <a href="{{ front_page }}" title="{{ 'Home'|t }}" rel="home" id="logo">
            <img src="{{ logo }}" alt="{{ 'Home'|t }}" />
          </a>
        {% endif %}
  3. After the img tag, you'll see the alt text is currently set to "home"
  4. Edit the text here to whatever you like, as follows: <img src="{{ logo }}" alt="{{ 'My new custom alt tag'|t }}" />
  5. Be sure to keep the apostrophes on either side of your text, the |t afterwards, and double brackets in place.

For Drupal 7

  1. Start with a copy of your theme's page.tpl.php file to edit
  2. Locate the code that is rendering your logo. It will look something like the following:
          <?php if ($logo): ?>
          <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
            <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
          </a>
        <?php endif; ?>
  3. Locate the img tag, followed by the print $logo text. Here's your logo image. Following that is the alt tag, which currently has the value of "Home".<img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
  4. You can remove the current snippet and add you own ALT tag, such as: <img src="<?php print $logo; ?>" alt="My Site Logo" />
  5. You can also keep the existing snippet and add your own text afterwards, such as: <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?> and my custom alt text" />

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.