After converting my gallery from Coppermine to NextGEN, one of the only downsides was the non-SEO friendly nature of NextGEN’s default permalink structure.
After searching through Google, its seemed others had also raised the issue, but the feature was as-yet unimplemented by Alex Rabe, NextGEN’s developer. Undaunted by this, I set about dismantling NextGEN’s code to implement it myself.
So, after several hours of coding, hacking and bug-fixing, I have released the changed files for anyone who wants to implement the feature in the future. Just download the patched version of NextGEN (tar.gz | zip | changed files only) and replace your current NextGEN plugin files. You will need to update your permalink structure once after activating the SEO settings in the NextGEN Options page.
Disclaimer
Obviously there is a risk in using this as it I haven’t tested on anything other than my own website. Remember to backup your current nextgen-gallery plugin folder, as well as any customised CSS files you have.
I have submitted the changes to Alex, so hopefully they should be integrated into the next release of NextGEN.
If you have any questions/comments, please by all means ask
Update 21:00 BST, 8th July 2010
I have been testing the changes and have found a couple of minor bugs, mainly relating to the use of European characters and quotes in gallery/album names. These bugs have now been fixed, and a proof-of-concept for European characters is here.
The archives above have been updated to include these changes. If anyone can provide feedback (even a “it works!”) it would be much appreciated – I’m trying to save Alex as much testing as possible

Hey Craig,
I just wanted to say thank you soo much for such an amazing job. Truly has made my day
Let’s hope it gets incorporated into the next update
Hello, it is also very important to me to have good discriptive links. I am trying to install your patch and replaced the related files but i dont see how to activate the SEO settings in the NextGEN Options page or how to update the permlink structure. Right now i get this this message at the top of my pages. Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/jo/johnrjennings.com/wp-content/plugins/nextgen-gallery/lib/ngg-db.php:1509) in /var/www/html/jo/johnrjennings.com/wp-content/plugins/wordpress-mobile-pack/plugins/wpmp_switcher/wpmp_switcher.php on line 506
I would really appreciate your help.
John
Hi John,
The problem is a known issue, and it seems to stem from whitespace left at the end of the PHP files included with my patch.
Unfortunately I have a few personal problems I need to deal with at the moment so I’m holding all work on the plugin until I can dedicate a good chunk of my time to it.
If you would like to fix the problem yourself, try opening the following files and deleting any whitespace at the end of the file – you should end up with no blank lines at the end of the files.
Thanks for you feedback, I’ll update this blog when a new version of the fix is available.
Craig
Hi Craig, I just want to say thank you attempting to tackle this problem. The one thing I think NextGEN Gallery has been lacking all these years is a decent pretty permalink structure
I’m looking forward to more of your updates on the patch after 2nd Aug (or whenever you can find the time). Thanks again for your work on this!
Massive, massive boost to any blog
Hi Craig,
this is amazing! Thanks a lot, I had been looking for this for ages and finally I’ve found.
Great job!
hello,
good job.
But do you know how i can automaticaly create a post for each photo in order to put comment, vote …
Thanks for your comments, what you’re asking is beyond the scope of the SEO patch, so I would suggest asking in the official WordPress NextGEN support forum. I don’t think what you’re suggesting is possible, though.
with these modification, i don’t have the title of the photo in the link or in the title. is it possible yo have these ?
Unfortunately the image title isn’t currently implemented in either the page title or URL. When I get round to re-releasing the fix and working with NextGEN’s maintainer, I’ll have a look at adding that functionality.
Craig
ok thank you.
you can add the description of the photo in “meta description” too
Please post the updated files for 1.6 publically quickly
http://raptv.net/rapmodels/
here is my gallery but i can’t add comments to images.
anyone know that how do i add comments to below images?
Hi Graig,
I’m not clear on what format permalink your changes introduce. If you go to http://japanese-art.blog107.com/gallery/woodblock-prints/toshi-yoshida/ and click on the top left image then nextgen opens http://japanese-art.blog107.com/nggallery/page-23/image/26/ – with your enhancement what would that change to?
Also, is reversing your update just a matter of replacing your updates with the original nextgen file and updating the permalonks in wordpress?
Thanks in advance,
Mike.
Hi Mike,
The changes will replace the URL as follows:
nggallery –> gallery (or the unique slug you specify)
page-23 –> toshi-yoshida
image –> will disappear
26 –> will stay the same (I haven’t built image names into the code)
Reversing the changes is slightly more involved, as there are database schema changes I’ve made to store the “sanitised” name data. The basis behind my changes was to provide an SEO URL structure without having to create a page for each gallery/album, so while your current structure is SEO-friendly as far as the clicking on the image, there’s a lot of unecessary overhead and extra pages within WP to create the illusion of a full-fledged “gallery” like Coppermine.
Having said all this, Alex Rabe is making great strides in integrating my code into NextGEN itself – the changes are set for NextGEN v1.8 – so unless the SEO functionality is absolutely necessary, I would suggest waiting for the full NextGEN release.
Hi Craig,
Thanks for the super quick reply. As suggested I’ll wait for the NextGEN update.
Do you know off the top of your head
if nggallery pages (mine include content) rank or at least are crawled by the search engines?
Regards,
Mike.