I recently converted a client's photo gallery that was originally done in static HTML to ZenPhoto. It looks great and the client, a professional photographer, is very happy with how easy it is for him to upload and organize images now.
But... I'm finding it challenging to figure out how on earth I'm going to keep the old gallery's fairly respectable search engine rankings.
The one good thing about a static HTML gallery was that, even though it was a pain to update, it was easy to customize things like page titles, meta tags, etc. Now I know that in ZenPhoto I can add a reasonably optimized description to an album, and I can probably tweak the theme files to insert the album description as the meta description tag. And it's nice that the album title appears as h1 (at least in the theme I'm using), so it's clear to a search engine that it's the main title of the page.
But... There are a few other things that would be really nice to see from an SEO perspective. And I don't mean a "let's over-optimize the site by packing in an insane number of keywords" type of SEO perspective, but more of a genuinely useful "Let's identify this gallery as clearly as possible so that both search engines and people using them know exactly who it belongs to, what it's about, etc." perspective.
- First, it would be nice to be able to edit the meta tags directly, particularly for album pages, but some people might also want to be able to do it for images. I know the meta keywords tag is barely relevant any more, but the meta description tag is still what shows up as the page description in most search engine results.
And while the description entered into ZP for the album is better than nothing, what you want to tell someone who's already browsing the site about an album or image may be slightly different than what you want to tell someone who's browsing Google results and doesn't yet know anything about your site - for example, the description for internal use might read "These are some of my photos of squirrels" while the one for search engines might more appropriately read "Album of squirrel photos by Canadian urban wildlife photographer John Doe, with photos of squirrels playing, fighting, gathering nuts, etc." or whatever.
- Similarly, it would be nice to be able to have the option of specifying a different HTML page title from the album title used internally. On your gallery's main page, to continue the above example, it might look best to give the albums concise names like "squirrels", "raccoons", "pigeons", etc., but for the page name that shows up in search results (and strongly influences rankings), you might want "Squirrel Photographs by squirrel photographer John Doe" or something like that.
- I think I had a third point in mind when I started this message but it seems to have slipped away from me... :-/
If there's any way of doing either of the above in ZP at the moment that I've just missed somehow, please let me know. Otherwise, maybe these suggestions could be considered for future versions...
(I should perhaps add: no, the client I created this site for does not actually photograph squirrels. Just in case anyone was wondering... :-) )
Comments
Kind of kludgy, I know, and it would be a pain on a site with a lot of albums, but for a site with a relatively small number of albums (six in this case), it wasn't hard. I could probably also add a couple of lines to each case in the switch statement to assign a meta description and maybe an intermediate length version of the title to use in the h1 album title...
Anyway, that's a workaround that anyone with a bit of PHP knowledge and a desire for better search-optimized albums could use in the meantime.
I think the points you mentioned can all be done theme wise.
1. You can set up easily a theme to include for example the tags you can assign to a album or a theme to print into a meta tag.
2. You can use for example the custom field that every album and image has to set up a special page name.
Please take a look at our functions documentation and maybe the theming tutorial on our site's user guide section.
This gallery was the first time I'd used ZenPhoto, so I just adapted one of the downloadable themes rather than creating one from scratch, but I liked it enough that I have several more in the works now, and ZP has thoroughly supplanted Gallery 2 in my affections. :-)
automated sitemap.xml
The addition of meta-tags can be easily added on each of your template pages, such as index.php, album.php, images.php news.php and pages.php etc.
What I did was set up the default tags being
<meta name="DC.Title" content="" />
<meta name="Description" content="" />
<meta name="DC.Description" content="" />
<meta name="Keywords" content="" />
<meta name="DC.Subject" content="" />
I then added new functions in the zenpage-template-functions.php, being;
/* added a bare news content for meta tags */
function getBareNewsContent() {
return html_encode(getNewsContent(200));
}
/* added a bare page content for meta tags */
function getBarePageContent() {
return html_encode(getPageContent(200));
}
The 200 is a character count - any more than 200 here is pointless really.
Used the same php code for the DC.Title as used in <title>
Then added the <?php echo getBareNewsContent() ?> or <?php echo getBarePageContent() ?> into the meta tags of Description and DC.Description
The Keywords and Subject however I am still trying to work out. I am trying to work out a way to weight all words in the content and list them comma separated from most common to least common but remove common words such as it, that, and and so on.
For the Images and Albums files you will need to define your functions or use existing functions found in the main zenphoto template functions file similar to what is above - using getBareImageTitle etc or whatever you would like.
Anyway I hope that helps a little and if someone has some code they can share to do the keywords that would be a great addition - maybe then I can pull it all together and do an SEO metadata plugin or the Core Devs can look at adding this in the next release
function getBarePageContent() {
return my_truncate_string(html_encode(getPageContent($titlelink,$published)), 200);
}
and then insert <?php echo getBarePageContent() ?> in the appropriate meta tags
Cheers
Your functions might be of interest to other Zenphoto users. I suggest you collect them in a plugin (rather than modify the Zenphoto core.) If you create such a plugin we can add it to the Website.