Title: Gallery does not include ALT attribute?
Last modified: August 19, 2016

---

# Gallery does not include ALT attribute?

 *  [RyanWilliams](https://wordpress.org/support/users/ryanwilliams/)
 * (@ryanwilliams)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/gallery-does-not-include-alt-attribute/)
 * I’ve always found well tagged images to perform exceedingly well on Google Images,
   but to my surprise the default gallery code in WordPress doesn’t include them—
   even if you specify them in the media manager.
 * Anyone have any ideas what I can do here? The alt attributes appear fine if I
   insert images properly using the media manager, but for the generated galleries
   they’re nowhere to be seen.
 * Here’s my image.php if it helps:
 *     ```
       <?php get_header(); ?>
       <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>
       <?php $attachment_link = get_the_attachment_link($post->ID, false); // This also populates the iconsize for the next line ?>
       					<div class="attachment_page title_type_1 standard_page with_breadcrumb">
       						<span class="breadcrumb"><a href="/">Home</a><?php
       $parent_id  = $post->post_parent;
       	$breadcrumbs = array();
       	while ($parent_id) {
       	$page = get_page($parent_id);
       	$breadcrumbs[] = '<a href="'.get_permalink($page->ID).'" title="">'.get_the_title($page->ID).'</a>';
       	$parent_id  = $page->post_parent;
       }
       $breadcrumbs = array_reverse($breadcrumbs);
       foreach ($breadcrumbs as $crumb) echo ' &raquo; '.$crumb;
       ?> &raquo; </span>
       						<h1>Image: <a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
       						<div class="standalone_attachment">
       <?php echo wp_get_attachment_link(0, 'medium', false); ?>
       						</div>
       						<div class="attachment_controls">
       							<div class="container">
       								<span class="previous"><?php previous_image_link() ?></span>
       								<span class="next"><?php next_image_link() ?></span>
       							</div>
       						</div>
       					</div>
       <?php endwhile; ?>
       <?php endif; ?>
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>
       ```
   

The topic ‘Gallery does not include ALT attribute?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [RyanWilliams](https://wordpress.org/support/users/ryanwilliams/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/gallery-does-not-include-alt-attribute/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
