Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 3.17   Updated Monday, July 6th, 2009 at 9:21pm

Sitemap Generator Plugin for Wordpress

This plugin creates a sitemap for your WordPress powered site. This is not just another XML sitemap plugin, but rather a true sitemap generator which is highly customizable from its own options page in the WordPress admin panel. Some of its features include: support for multi-level categories and pages, category/page exclusion, multiple-page generation with navigation, permalink support, choose what to display, what order to list items in, show comment counts and/or post dates, and much more. To see this plugin in action, visit my sitemap page.

Download

  If you have found this page useful, please consider donating. Thanks!

Languages

The latest version of this plugin includes complete support for language files. If you would like to submit a translation, please contact me. You can choose the language from the options page.

Current languages: English, Albanian, Arabic, Brazilian-Portuguese, Bulgarian, Catalan, Czech, Danish, Dutch, Estonian, Finnish, French, German, Italian, Japanese, Lithuanian, Norwegian, Polish, Romanian, Russian, Simplified Chinese, Serbian, SerbianLatin, Slovene, Spanish, Swedish, Turkish, Ukrainian

The language file contains not only the text shown on the sitemap page, but all of the text in the options page as well.

Changelog

  • 07-06-09 Version 3.17 – Fixed some translation issues. New string added to language files: DDSG_CONTINUED (used the English word for all existing translations). Added Finnish and Estonian languages. Updated Danish language. Various other fixes. Tested in WP 2.8
  • 02-22-09 Version 3.16 – I have switched back to hosting this plugin on this site, instead of the WP plugin repository. This should cause less confusion. New language files have been added: Arabic, Catalan, Danish, Norwegian, Serbian, and SerbianLatin. An issue has been fixed with the Czech lang file. An issue with the previous/next links not being translated has been fixed as well. Tested in WP 2.7.1
  • 09-17-08 Version 3.15 – This is a minor update that fixes the issue some users were having with permalinks when using multiple sitemap pages.
  • 05-12-08 Version 3.14 – Fixed an issue for xhtml compliance. Removed trailing whitespace in plugin file (was cause of ‘headers already sent’ error for some). Adjusted code to handle permalinks better.
  • 04-26-08 Version 3.13 – The plugin has been tested and works in WP 2.5. Added language files: Lithuanian, Romanian, Italian, Ukranian, and updated Spanish. Updated for compatibility with the WP Security Scan Plugin (thanks Michael). Undefined offset errors should be gone now. Updated the code that displays post/page titles. Fixed issue where comment counts showed on new lines.
  • 09-26-07 Version 3.12 – Instead of having separate plugin versions for pre and post WP2.3, this version handles everything from WP 2.1 to 2.3. There is a separate download for those using WP 2.0. A bug was also fixed that caused posts to be duplicated in 2.3.
  • 09-22-07 Version 3.11 – Bug fixed – categories were not showing up if they had a parent category with no posts.
  • 09-20-07 Version 3.1 – Now supports WordPress 2.3. Added Czech, Russian, and (updated) French language files.
  • 07-27-07 – Not a version update – added Albanian, Bulgarian, Swedish, and Turkish language files.
  • 07-08-07 Version 3.07 – Post titles with html formatting should now show up properly in the sitemap. Slovene language file added.
  • 06-22-07 Version 3.06 – Updated to display sub-categories (with posts), even when parent category has no posts.
  • 06-20-07 Version 3.05 – Ampersands (in titles) issue fixed.
  • 06-18-07 – Not a version update – added French and Brazilian-Portuguese language files.
  • 05-31-07 Version 3.04 – Better support for international date formatting added (using the date_i18n function). Option to limit multi-cat posts to one cat removed for now due to incompatibility issues. Spanish and Polish language files added.
  • 05-17-07 Version 3.03 – Parse error bug fixed. Non-published (draft) pages now hidden.
  • 05-16-07 Version 3.02 – Updated to work with WordPress 2.2. Drafts no longer appear in the sitemap. Added new languages: Simplified Chinese, Dutch, and Japanese.
  • 05-09-07 Version 3.01 – Bug fixed with future post check. German language file added.
  • 05-03-07 Version 3.0 – This is a very big update. Most of the plugin has been rewritten from the ground up. Many things have been fixed, several new features have been added, and it runs much faster than before. Be sure to read the updated information below.
  • 03-24-07 Version 2.73 – Sitemap page navigation will no longer show ‘/1/’ in the URL for the first page. The same method has also been applied for those not using permalinks.
  • 02-09-07 Version 2.72 – Fixed a compatibility issue with this plugin and some of my others.
  • 01-25-07 Version 2.71 – Fixed bug when used with WordPress 2.1
  • 09-17-06 Version 2.7 – You can choose to show excerpts even when a post or page title exists. They settings are now independent.
  • 04-02-06 Version 2.6 – The page and category exclusion lists are no longer case-sensitive. An issue has also been fixed for excluded categories that have non-excluded sub-categories. They now show up properly. Lastly, an issue was fixed where sites with more than 10,000 posts were having problems generating the sitemap.
  • 03-23-06 Version 2.5 – Lots of optimizations, runs much faster. Can now exclude pages (and subpages). Options page completely redone. All visible text is an option (under Language Settings). Comment count only counts approved comments.
  • 03-21-06 Version 2.4.2 – Some minor code adjustments. Works properly when the Google Analytics plugin by boakes.org is enabled.
  • 03-18-06 Version 2.4.1 – Several minor issues fixed. Rewrite code greatly improved. Added option to change ‘continued text’. Can now generate sitemap on error pages.
  • 03-14-06 Version 2.4 – Several requested features added: Choose to show everything, or just posts or pages. Can show publish date for posts (and configure the date/time format). Added ability to exclude categories. Option to open links in new windows
  • 02-16-06 Version 2.3.1 – Fixed uploads/attachments showing up in sitemap.Fixed small bug when sorting pages by title.
  • 01-23-06 Version 2.3 – Permalink support for navigation added! (read permalink section below for more info)
  • 01-22-06 Version 2.2.1 – Option to hide password-protected items. Fixed navigation bug (when Wordpress was in sub-folder).
  • 01-21-06 Version 2.2 – Rewritten again! – Handles multi-level categories and pages. Continuation of previous posts/pages shown. Customizable text for category pages. Separate sort orders for posts and pages. CSS added for easy customization. Always hides drafts and future-dated posts now (there’s no reason not to). Multi-category posts handled much better. ‘Breadcrumb trail’ for sub-categories. For posts without titles – display ‘(no title)’, first X characters, or first X words. And many other fixes/updates.
  • 01-14-06 Version 2.0 – Rewritten completely, and turned into a plugin
  • 01-15-06 Version 2.1 – New features and various fixes: –
    Handles custom table prefixes. Fade effect upon submitting options (for WP 2.0 users). Option to display posts or pages first. For posts without titles, choose to ignore, use “(no title)”, or first few words of text. Place sitemap navigation at the top, bottom, or both.
  • 01-14-06 Version 2.0 – Rewritten completely, and turned into a plugin
  • 12-08-05 – Original (non-plugin) version 1.0

Installation

  • Download sitemap-generator.zip and uncompress
  • Upload the entire sitemap-generator folder (not just the files inside) to your plugins directory
  • Activate the plugin in your administration panel
  • Configure the plugin in the options panel (under DDSitemapGen)
  • If using permalinks, read the permalink section below
  • Simply add the following line to a WordPress page (where you would like the sitemap to display):
    <!-- ddsitemapgen -->

    Note: For those of you using the new rich-text editor – be sure to click the ‘html’ button to edit the page source directly. Otherwise Wordpress will wrap code tags around the line which generates the sitemap and it will not work properly.

Upgrading?

To upgrade, disable and then delete the existing plugin. Then install the new version as explained above.

Be sure to use the new language files, as new text may have been added.

After you install, be sure to click the ‘Load Default Options’ button, as some of the settings have changed.

Version 3.0 of this plugin is a big jump from the previous versions. Most of the code has been rewritten from scratch, and a few things are different. One of the best improvements is the speed and stability. The sitemap generation is much faster now, which should especially help people with larger sites. Be sure to read the updated information below.

Want to run the plugin from a template file?

To use the sitemap generator function directly from a template file, just insert the following line where you would like the sitemap to be generated:

<?php echo ddsg_create_sitemap(); ?>

Permalinks for sitemap navigation

Depending on your settings, the sitemap may be spread across multiple pages. If you are using permalinks, be sure to enter the page slug of your sitemap page in the plugin options. That way it will use permalinks for the sitemap navigation as well. If you are not using permalinks, simply leave this option blank. Notice: After changing the sitemap page slug setting, be sure to update your permalink structure.

CSS declarations

This plugin has a couple of CSS classes built in to easily change the look of your sitemap. Just add the new declarations to your themes CSS file, and customize it however you like.

  • .ddsg-wrapper – Div around the entire sitemap.
  • .ddsg-pagenav – Div around the page navigation.

Available Options

These options can be configured from the options page in the WordPress admin panel. Most of these are fairly self-explanatory.

General Options

  • Language – Language files are located in /wp-content/plugins/sitemap-generator/lang/
  • Items per page – Set to 0 for unlimited
  • Sitemap page slug – If using permalinks, enter the slug of your sitemap page. Notice: After changing the sitemap page slug setting, be sure to update your permalink structure

Sitemap Generation

  • What to show – Show posts, pages, or both
  • If showing both, which first – Show posts or pages first
  • Post sort order – Sort by title or date (oldest or newest first)
  • Page sort order – Sort by title or date (oldest or newest first) or menu order (ascending or descending)
  • Show comment count after posts
  • Show comment count after pages
  • If showing comment counts, display when zero
  • Show dates after posts
  • Show dates after pages
  • Date format (if showing dates) – Use PHP date() formatting

Exclusions

  • Excluded categories – Category IDs, separated by commas. Sub-categories will also be excluded, as well as all posts contained in excluded categories
  • Excluded pages – Page IDs, separated by commas. Sub-pages will also be excluded
  • Hide future-dated posts
  • Hide password-protected items

Navigation

  • Sitemap navigation method – Two types to choose from
  • Show sitemap navigation – Where to show the navigation

Miscellaneous

  • Full path to XML sitemap – If you are also using an XML sitemap plugin, you can enter the path to the XML file here, and a link to it will be added to your sitemap page
  • Where to show XML sitemap link – At the end of the last page, or at the end of every page

Troubleshooting

If you are using the permalinks for multiple sitemap pages, be sure that you have updated your permalink structure after changing the page slug option so that it will recognize the new permalinks generated by the plugin.

Pages: « 17132 31 30 29 28 [27] 26 25 24 23 221 » Show All

  1. 405
    Eric

    When used, it’s only showing pages — not posts. When I configure the plugin to only show posts, I get the following error:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT post_content FROM wp_posts WHERE ID=
    
        * (no title) - ... 

    >>> Suggestions??

  2. A W E S O M E! thank you very very much. works like a charm, exactly what i was looking for.

  3. [...] Dopo tanto scroccare, ho fatto il mio primo fioretto alla comunità Wordpress: ho tradotto il plugin che utilizzo per la mappa del sito. Spero bene. Per chi fosse interessato, si può scaricare dal sito di  Admin, http://www.dagondesign.com, nella pagina dedicata a Sitemap Generator, questo il nome del plugin. Lo cercavo da tempo, come strumento per chi vuole navigare nel sito senza cambiare troppe pagine: un click et voilà, tutto a portata di vista e aggiornato. Nello stesso tempo, dicono sia un ingrediente necessario per il SEO, Search Engine Optimisation, la religione a cui si è votati se fai un sito e lo vuoi far leggere: una buona indicizzazione sui motori di ricerca. Non credo basti una mappa del sito per un buon posizionamento, me ne rendo conto soprattutto se non scrivo. Ma è uno strumentino decisamente utile e non crea problemi ad installarlo. Almeno, non a me. Il plugin è semplice da utilizzare, si installa nella cartella dei plugin, si scelgono le opzioni nella scheda che genera nel pannello di amministrazione, si crea la pagina statica e si inserisce il codice (non html, attenzione, nessuna tag) e via: ecco dispiegarsi in ordine i titoli delle pagine, delle sottopagine (nel caso si scelga questa opzione), i link ai post divisi per argomenti (io chiamo così le categorie). Più altri piciarelli per la navigazione, nel caso la tua mappa del sito si sviluppi su diverse pagine (anche questa è un’opzione). Insomma, è comodo. [...]

  4. [...] WP-DB Backup – sauvegarder facilement sa base de donnée. Optimal Title – place le nom de votre blog dans le titre des pages. Rate My Stuff – noter les billets avec des petites étoiles. Static front page – utiliser Wordpress pour gérer un site statique. Permalink Redirect – met une redirection 301 en place directement si l’url tappé est différent du permalink. Sitemap Generator Plugin for Wordpress – créateur d’un plan de site pour votre blog, très bon pour le référencement. SH-Autolink – transforme automatiquement une liste de mots pré-définis en hypertexte. WP-ContactForm – créer facilement un formulaire de contact sur le blog wordpress. [...]

  5. Version 2.7 of this plugin is now available in Italian – translated by Enrico Rotelli.

  6. Joe: That is possible, but it would require a bit of code. Here is one thing you can try. Find the following line:

    $data1 .= '<li><a href="' . get_permalink($ddsg_data[$i]['id']) . '"' . $ddsg_new_window . ' rel="nofollow">' . ddsg_get_title($i) . '</a>' . $show_post_date . ddsg_num_comments($ddsg_data[$i]['id'], 'post') . '</li>';

    This is where it displays each post link. What you could do is use a switch statement or something to check the category id (for this, use $ddsg_data[$i]['cat_id']), and depending on the value, insert a different class definition into the link, or li tag, which displays a different color. You would have to create the new CSS classes of course. Another option would be to hard-code the style definitions directly into the script, but it is still just a matter of checking the cat_id and using the color you want for each id.

    Kris: There is currently not. Because of the way the sorting and display functions are written, it would not be possible without some serious code rewrites. It just has to do with the way it processes the posts when organizing them for display.

  7. 399
    Joe

    I’ve found this plugin really useful but I’d like to tweak it abit, hope you can help. Is it possible to make difference color for each category post because my blog has a long list of categories and posts so if we can assign each category posts with different color would be great for visitor to view it.

  8. [...] Dagon Design Sitemap Generator [...]

  9. Is there a way to group the categories with their children? Or maybe one of your sorting options should be by category number.

    my sitemap is currently located at http://www.thewellministries.org/sitemap/

    I wish I had found your plugin before I started setting up all the children categories in which I created my own sitemap using the list_cats command. In addition I’m using the fold category list plugin to show the children categories when someone clicks on the main category in the sidebar.

    Looking forward to implementing it on my other sites.

  10. Fantastic, easy-to-install and -use plugin. Thank you very much!

  11. 395
    ovidiu

    hello alleister,

    like I told you in previous comments here I was trying to get your plugin to work with wpmu. As it did not work, due to some differences in the table structure I asked a friend to change it for me.
    Here are the differences as I have found out (no guarantee though):

    wp: if post_status = static => it is a page
    wpmu: if post_status = published THEN check if post_type = page or post to find out if its a page or a post.

    The relevant data that had to be changed was this:

    
    $items = $wpdb-&gt;get_results("
    
    SELECT post_title, ID, post_parent, post_name
    
    FROM {$table_prefix}posts, {$table_prefix}post2cat, {$table_prefix}categories
    
    WHERE post_parent = '$id'
    
    AND post_status = 'publish'
    AND post_type ='page'
    
    AND ID = {$table_prefix}post2cat.post_id
    
    AND {$table_prefix}post2cat.category_id = {$table_prefix}categories.cat_ID
    
    AND post_date 

    I hope my code doesn’t lose its formatiing.

    P.S. the changes were done by adrian.ceapa@zice.ro and I hope it works out for all of you using wpmu

  12. Yick: This plugin does not generate an XML sitemap, but rather just a traditional sitemap. That option is for people who use another plugin for an XML sitemap – it simply allows you to have a link to the XML sitemap automatically placed on your ‘normal’ sitemap that this plugin generates.

  13. Under:

    XML Sitemap Options
    Full path to XML sitemap

    How to set the path? Can give an example?

    I also want to know how dd-sitemap-gen generate the xml sitemap.

    Does it write a file on my server?

    Everything is working fine other than the xml sitemap.

    Yick

  14. [...] Dagon Design Sitemap Generatorh3> This sitemap plugina> generates a sitemap containing all posts and pages of your site. It is totally customizable. It allows you to choose what to display, how they are displayed, and what to exclude. Check out my sitemapa> to see a demo.p> [...]

  15. hello Alleister,

    I posted yesterday here with a modification to your script to make it differentiate between posts and pages with WPMU. I was posting from a dubious IP so I guess my comment got filtered out….

Pages: « 17132 31 30 29 28 [27] 26 25 24 23 221 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.