Improving SEO by setting an image's filename as its alt or title field
Images are often neglected in SEO and they provide a great opportunity to rank well in universal search (search results such as images, video and places).
For images to rank well you need three a minimum of three things set up to target your keyword phrase:
- The context of the page the image appears on (on page SEO should be applied)
- The filename of the image
- The alt text
Additionally you should add:
- Title text
- Comments embedded in the image file
Adding comments into an image file can be time consuming but can usually be done by editing the properties of the image file before uploading. This can be done either in your operating system's file manager or in an image/photo editor.
Apart from the comments, everything else can be handled neatly by Drupal.
Here's what we will achieve:
- Alt and title text fields for images
- Automatic file renaming of images using the alt text
Prerequisites for automatic file renaming
- Token To provide replacement tokens
- File (Field) Paths To rename the file
- Entity API To provide the alt and title text replacement tokens
How to rename the image file using the alt text field
- Install the above modules as well as Entity tokens (included in the entity module)
- Add/Edit your image field and:
- Turn on alt and title fields
- Enable File (Field) paths
- Under File name options remove the file name token (leave the extension token)
- Check "Cleanup using pathauto"
- Open up replacement patterns and find Nodes >[Your image] and click [node:[your image]:?]
- Edit the pattern and change the "?" to alt
Now any images you upload into this field will have their filename replaced with the alt text!
Submitted by oliver on Thu, 24/04/2014 - 11:05
Author of...

Post new comment