| Tweet | ||
| Pin It |
I was looking for a good image sitemap generator for WordPress, but of course found nothing really good. So, I wrote my own ![]()
2011-01-14 Update: XML Image Sitemap is now available from WordPress.org
I’m still fascinated by image search results, and hope this will help me rank for some keywords (or at least understand things better)



{ 32 comments… read them below or add one }
Thanks for this
My pleasure. Maybe I’ll re-release this as my first WordPress plugin
Do you know of an image sitemap generator for standard websites? I’ve found one that will specifically create an image sitemap but it doesn’t pick up the title of the image, only the location and filename. It picks up the filename and puts that in the title place. Please let me know if you know of a generator. Thanks.
Hi Vicki –
That would be kind of difficult, as you wouldn’t know what page the image is on. However, I imagine you could write something that reads an “images” directory and then use the exif_read_data php function to read the comments. But, again, knowing what page that image is on is the hard part.
Super cool stuff. I added the file to the FryingPanSports.com site. I couldn’t get the xml extension to work but submitted the php extension and Google didn’t have any issues with it.
Yeah, I don’t think Google cares what the extension is. Now make sure you add titles to your images, so the “caption” is useful to the search engines (I see you’ve done this the past 2 posts)
Hey man do you have an live example of how this should like like ?
I tried this http://www.ericnagel.com/sitemap-image.xml but do not think that it’s what i suppose to see right ?
Hi,
Yeah, that’s it. View Source, and you’ll see some formatting. I’m working on a WordPress Plugin that’ll do all of this automatically, but I’m having trouble submitting it to WordPress.org. I’ll get it up today, either here or on WordPress.org
It’s the only image sitemap plugin that works for me.
However the URLs are not “pretty”… I’m getting the default, ugly, wordpress urls like this: http://www.domain.com/?p=253
Do you know how to fix it?
Do you have your permalinks set right in your wordpress options? domain.com/wp-admin/options-permalink.php
I also created a sitemap plugin recently – you can check it out here- http://www.pushpinderbagga.com/google-xml-image-sitemap-generator-plugin-for-wordpress/439/
after i submit the image sitemap to google webmaster tool used this plugin, i lost my index in google image, Do you know how to fix it? please
Start by using actual captions for your images. For example, you have:
hayden-panettiere-wallpaper-hot
Change the caption to:
Hayden Panettiere Wallpaper – hot!
As for why Google dropped you from the Image results, it could be many things. If you think the sitemap is at fault, remove it from your Webmaster tools account. But, I’ve successfully used this on numerous sites and have images listed in the image search results.
Hi Eric,
It might be how it is suppose to work, but it seems when multiple posts are sharing the same image, only the first (date) post is listed as location
Sorry, my mistake. It seems -looking at the media manager- this is simply how WordPress does things (:
Yeah, an image will only be in the image sitemap once. You could always upload it twice, I suppose.
Thanks Eric, for confirming this. This quick btw.! (:
Thus far I’m completely liking your plugin.
I’ve made one minor change though -not entirely sure if I can past code here.
I’ve changed the post_title title to image:title instead of having both as image:caption.
This way image:title shows if only the title has been submitted.
Any chance including both in a perhaps future release?
Meaning always showing the post title OR if different showing the image title (this is how the plugin currently works) AND if there showing the image caption.
Sorry I can’t make myself not more clear. PHP doesn’t seems to be my native language (:
I’ll review this – my latest post isn’t showing in the sitemap, so I wonder what’s stopping it.
I struggled with showing the image caption, or title, or alt-text. Ideally, that’d be an option in the plugin, right?
Version 2.0
Kind of forgot there’s also an alt-text (: But currently the post title, image title and image caption just seems to work just right.
hi eric,
i’am use your plugin but only one picture was displayed??
any idea?
http://www.spreephoto.de/sitemap-image.xml
The plugin uses images that were uploaded as Media using WordPress (when you create a post or page, and you click on the “Upload/Insert” Image, and get the pop-up to “Add media files from your computer”).
Your site looks great, but it looks like you’re using some sort of plugin to handle your gallery. I’m guessing they’re just not stored properly in the WordPress database.
hi eric,
all my pictures using the wordpress media database..
Unfortunately, without access to your database, I can’t debug much more. Try running the SQL command:
SELECT * FROM wp_posts
WHERE post_type = ‘attachment’
AND post_mime_type like ‘image%’
ORDER BY post_date desc
and see what comes back. The results must not have a post_parent of 0.
I’m esnagel on Skype, if you want further help.
@eric
the result:
Zeige Datensätze 0 – 29 (1,235 insgesamt, die Abfrage dauerte 0.0034 sek.) [post_date: 2011-04-30 11:40:54 - 2011-04-29 21:46:45]
1.235 pictures in database
Hi Eric,
In a future version perhaps, would it be possible to change $post->guid to something different php-ish? Sorry, databases aren’t really my language.
$post->guid seems to be more an ID than a permalink, which could cause some difficulties when changing from website URL.
Hello,
guid converts to something like
http://www.ericnagel.com/wp-content/uploads/2011/05/50dollar.jpg
it’s the URL of the image, not an ID
Hi Eric,
More or less it does seem to be. Ie. when moving from http://my1stdomain.com/wp-content/uploads/2011/05/50dollar.jpg to http://my2nddomain.com/wp-content/uploads/2011/05/50dollar.jpg the $post->guid will stay as http://my1stdomain.com/wp-content/uploads/2011/05/50dollar.jpg
What are you using to move the image? guid is a value from the database. I’m sure if you move / rename the image with FTP, the database value will be wrong, and nothing will work. So… don’t do that.
Good stuff man!
I’ll definitely give this a shot on a couple of my sites.
Thanks!
-J
Just now downloaded the plugin. Seems to be good. Will post my opinion in some days.
Thank you for this plugin.I’m using this for 1 month and all my images indexed.Thanks
Thank you very much for this Plugin! I was also looking for a XML Image Sitemap and didn’t found anything really good – so if you say that yours is better i count on you!
{ 3 trackbacks }