Title: [Plugin: NextGEN Gallery] SEO Permalinks &#8212; Patch
Last modified: August 19, 2016

---

# [Plugin: NextGEN Gallery] SEO Permalinks — Patch

 *  [Craig Watson](https://wordpress.org/support/users/craigwatson/)
 * (@craigwatson)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/)
 * I’ve spent a couple of days rewriting NextGEN’s rewrite code (no pun intended!)
   and here is the result:
 * [http://www.cwatson.org/odd/nextgen-1.5.5-cw.tar.gz](http://www.cwatson.org/odd/nextgen-1.5.5-cw.tar.gz)
 * Changed files are:
    nggfunctions.php lib/ngg-db.php lib/rewrite.php
 * There are several code changes, so I won’t list all changes here. You can either
   replace the files above or replace the whole nextgen-gallery folder in your plugins
   directory.
 * After replacing the files, log into your wp-admin console and go to your NextGEN
   options. Click on the “Permalinks” tab, and the options should be self-explanatory.
 * **Disclaimer**
    Note to anyone upgrading to this patch, 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.
 * Demo gallery is here: [http://www.cwatson.org/gallery](http://www.cwatson.org/gallery)
 * I have submitted the code changes to Alex (NextGEN’s developer) so hopefully 
   they should be incorporated into a NextGEN release sometimes soon 🙂
 * Any questions, please ask 🙂
 * [http://wordpress.org/extend/plugins/nextgen-gallery/](http://wordpress.org/extend/plugins/nextgen-gallery/)

Viewing 15 replies - 1 through 15 (of 33 total)

1 [2](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/page/2/?output_format=md)

 *  Thread Starter [Craig Watson](https://wordpress.org/support/users/craigwatson/)
 * (@craigwatson)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571578)
 * Update: I have uploaded a zip version of the archive, as well as just the changed
   NextGEN files:
 * [http://www.cwatson.org/odd/nextgen-1.5.5-cw.zip](http://www.cwatson.org/odd/nextgen-1.5.5-cw.zip)
   
   [http://www.cwatson.org/odd/nextgen-1.5.5-changed.zip](http://www.cwatson.org/odd/nextgen-1.5.5-changed.zip)
 * I have also confirmed that the patch works on both the standard and ImageBrowser
   settings. If anyone spots any bugs or problems, please let me know 🙂
 *  [aleksgeo](https://wordpress.org/support/users/aleksgeo/)
 * (@aleksgeo)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571742)
 * This is just what I’ve been looking for the past few days, it’s fantastic. I 
   don’t know if it’s because I’m doing something wrong, though, but my URLs include
   the album ID rather than name.
 * Check here for a couple of examples: [http://www.aleksgeo.com/gallery/](http://www.aleksgeo.com/gallery/)
 * The way I understand it from the sample gallery you linked to, the URL linking
   to the gallery “Testing 1” should be [http://www.aleksgeo.com/gallery/bulgaria/testing_1/](http://www.aleksgeo.com/gallery/bulgaria/testing_1/)
   but it’s [http://www.aleksgeo.com/gallery/1/testing_1/](http://www.aleksgeo.com/gallery/1/testing_1/).
 * Like I said, not sure if I’m doing something wrong or if there’s a problem with
   the files somewhere. Any help with the problem would be appreciated though.
 * Oh, and uploading only the 3 changed files doesn’t add the permalinks tab to 
   the options page, so it’s kinda hard to use it 😛
 *  Thread Starter [Craig Watson](https://wordpress.org/support/users/craigwatson/)
 * (@craigwatson)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571757)
 * Apologies, I missed one file out of the changed files archive, so the options
   weren’t added into the admin panel.
 * I have replaced the changed files archive with the correct one so the problem
   is fixed now.
 * The way I had my gallery set up is that I have album/subalbum/gallery, all placed
   into a main “Gallery” album. Can you give your layout?
 *  Thread Starter [Craig Watson](https://wordpress.org/support/users/craigwatson/)
 * (@craigwatson)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571761)
 * I’ve also been bugfixing some problems with albums embedded in posts – seems 
   to be the same problem you’re having.
 * I’ve fixed the bug so if you can replace the files again, and also update your
   permalink structure, the problem should be fixed.
 * I have a test post at [http://www.cwatson.org/2010/07/07/test-gallery-post](http://www.cwatson.org/2010/07/07/test-gallery-post)
   and that seems to be working fine 🙂
 *  [aleksgeo](https://wordpress.org/support/users/aleksgeo/)
 * (@aleksgeo)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571854)
 * Seems to be working great now!
 *  Thread Starter [Craig Watson](https://wordpress.org/support/users/craigwatson/)
 * (@craigwatson)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571862)
 * Aleks,
    Thanks for the feedback, glad it’s working for you 🙂
 * I’ve found some bugs with non-standard characters and quotes being used in album
   and gallery names, so these bugs have now been fixed. A proof of concept gallery
   for non-standard characters is:
 * [http://www.cwatson.org/gallery/we_will_%22r%C3%B6ck%27_you/s%C3%B6me_g%C3%A3llery_with_l%C3%B6ts_%C3%B6f_specialchars_&_o%27er_%22stuffs%22/](http://www.cwatson.org/gallery/we_will_%22r%C3%B6ck%27_you/s%C3%B6me_g%C3%A3llery_with_l%C3%B6ts_%C3%B6f_specialchars_&_o%27er_%22stuffs%22/)
 * As with previous bugfixes, you will need to update your permalink structure once
   after applying these fixes.
 * The archives in the first post have been updated, so you can either download 
   the full archive or the changed files.
 * If anyone else can provide feedback (even a “it works!”) it would be much appreciated–
   I’m trying to save Alex as much testing as possible 🙂
 * Cheers,
    Craig
 *  [aleksgeo](https://wordpress.org/support/users/aleksgeo/)
 * (@aleksgeo)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571869)
 * I noticed gallery names with special characters messed it up, and the latest 
   files are an improvement, but I managed to break it again.
 * If you take a look [here](http://www.aleksgeo.com/testing/) you’ll find two galleries,
   one with an apostrophe and one with elliptical brackets in their names. When 
   you click on them they work fine*, but once you try to move to the second (or
   any other) page the links break.
 * The one with the apostrophe just gets a backslash added before the apostrophe,
   but the one with the brackets is weird. When you hover over the link it shows
   the brackets in the link you’re about to go to, but they disappear once you click
   on it and the page loads.
 * *Oh, I just noticed that IE, Opera and Safari can’t display galleries or albums
   with apostrophes properly unless you change them to %27 in the URL bar. Hope 
   that helps.
 *  Thread Starter [Craig Watson](https://wordpress.org/support/users/craigwatson/)
 * (@craigwatson)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571879)
 * Hi Aleks,
    Just to keep you (and everyone else here) updated about this, unfortunately
   I have some freelance projects that need to be completed, so I won’t be able 
   to address the issues until week beginning 19th July.
 * After this, I should hopefully be able to look again at the plugin and deliver
   a more “complete” solution – the characterset problems can be solved by sanitising
   the gallery/album titles in the same way that WordPress sanitises page/post titles.
 * To store sanitised information, extra fields need to be added into the database
   schema, so I’ll need to test these fully (including migration scripts) and release
   a “v2” of the patch – that is unless Alex Rabe releases them in NextGEN.
 * Cheers for all the help, please keep using the patch if you don’t mind having
   to avoid special characters and quotes in gallery/album titles.
 * Craig 🙂
 *  [gearsdigital](https://wordpress.org/support/users/gearsdigital/)
 * (@gearsdigital)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571884)
 * He Craig,
 * you should remove the trailing whitespace in your files after the closing (`?
   >`) Php Bracket. I’ve got some “Headers allready sent” Errors. After removing
   the whitespace it works like a charm 🙂
 * Thanks for your work.
 *  Thread Starter [Craig Watson](https://wordpress.org/support/users/craigwatson/)
 * (@craigwatson)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571885)
 * Hi,
    Cheers for the heads-up, I’ll add it to the things I need to check for v2–
   which file was producing the errors?
 * Craig
 *  [gearsdigital](https://wordpress.org/support/users/gearsdigital/)
 * (@gearsdigital)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571886)
 * You’ll find the whitespace in all of the 4 changed files. I’ve used a clean WP3
   Install (german localization) to test it out. It seems to be reproducable.
 *  [gearsdigital](https://wordpress.org/support/users/gearsdigital/)
 * (@gearsdigital)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571890)
 * Craig,
 * is there a way to display galleries like this `http://example.com/photos/galleryname`
   and any further gallery `http://example.com/photos/other-galleryname` ?
 * `http://example.com/photos/` should be an overviewpage of all Galleries.
 * Currently i got urls like this one: `http://example.com/photos/photos/galleryname`.
   
   The first photos section is a wp-page where i call the album`[album id=1 template
   =extend]` .The name of the Album is also photos… Any suggestions?
 *  [brightsites](https://wordpress.org/support/users/brightsites/)
 * (@brightsites)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571899)
 * Legend… Just wanted to say thanks for this mod.
 *  [brightsites](https://wordpress.org/support/users/brightsites/)
 * (@brightsites)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571900)
 * Is there a way to change the Page title to me more SEO friendly?
 *  [Sjeng](https://wordpress.org/support/users/sjeng/)
 * (@sjeng)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/#post-1571904)
 * I’m not sure if this is really related, but I’ve noticed something with the album
   links:
    I’ve made a page that contains all albums, which acts as the main page
   for all my photo-galleries. When I click a gallery in an album, the gallery opens
   in the same page where I was, only leaving out all other albums, and only showing
   me the gallery I clicked. The thing is, I’ve placed some text along with the 
   albums, so when I click on a gallery, I see the gallery plus all the text from
   the main photo-album page, which is NOT what I wanted. I’ve created sub-pages
   for all seperate albums, like so: Photo-albums (main page with text + all [album
   id=x template=extend] codes)
    - |___Album 1 (page with 1 [album id=x template=extend] code)
    - |___Album 2 etc.
 *  1. |____gallery 1 (page with 1 [nggallery id=x] code)
    2. |____gallery 2 etc.
 * These pages work fine when I use my menu navigation, but the **albums** do not
   link to these pages. Instead they open the albums on the **same page they’re 
   on** (the main photo-albums page) somehow. [here’s the page](http://www.harmoniestmichael.nl/foto-album/)
   
   Linking the albums to these pages from the nggallery menu doesn’t work, whether
   I use the permalinks option or not… I’ve actually noticed the same thing on the
   nextgen website itself… You can see how the page title remains the same, and 
   in the link url of the albums you can also see the link isn’t redirected to any
   subpages.
 * So either I’m doing something wrong, or there’s still something not quite right
   in the plugin…
    I hope I’m being clear 😛 kinda hard to explain… Would this patch
   fix that???

Viewing 15 replies - 1 through 15 (of 33 total)

1 [2](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/page/2/?output_format=md)

The topic ‘[Plugin: NextGEN Gallery] SEO Permalinks — Patch’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * ["search engine optimization"](https://wordpress.org/support/topic-tag/search-engine-optimization/)
 * [indexing](https://wordpress.org/support/topic-tag/indexing/)
 * [nextgen](https://wordpress.org/support/topic-tag/nextgen/)
 * [permalinks](https://wordpress.org/support/topic-tag/permalinks/)

 * 33 replies
 * 10 participants
 * Last reply from: [mykkal](https://wordpress.org/support/users/mykkal/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-seo-permalinks-patch/page/3/#post-1572012)
 * Status: not a support question