Category archive in menu

WordPress has actions and filter to be used to add elements on menu admin, and so it’s possible to write a plugin that put on the menu admin screen the month/year archives.

However, that plugin should consist in some dozen lines of code, and once you have not tried to write anyhing, if this was the only way to accomplish your request I think that your question had chances to be cosidere too broad.

But there is a simple way, that require just five minute of manual work and no one line of code.

You can use the ‘Links’ features of WordPress menu, and manually create the links.

For the top level, once you don’t want to link anything, you can use the '#' as url:

top level menu


After that, start creating the month archive links. Note that the links to put here depend on if you have pretty permalink activated or not, and if you have custom rewrite rules or not.

With pretty permalink activated, by defaults month archives are linked with, e.g., example.com/2013/09 so:

month archive


If you have not pretty permalinks activated, the link shuold be something like: example.com?m=201309.

Now repeat same operation for all months, and when you have to add the year archives link, use the url in the form example.com/2013/.

With no pretty permalink the links for year archive is example.com?year=2013.

year archives


This works perfectly, but once links are added manually, has 2 little issues:

  1. Links are not added automatically, when new month arrive you have to manually add the new link. (is possible to write some code that handle auto link creation, but this is another question…)
  2. If you add some custom rules that change the structure of montly and yearly archives url, the link will not works anymore. If you switch off pretty permalinks and you create url using them, urls will not work anymore (but if you switch them on, and link are created using the unpretty url version they continue to works).

Note that shortcode here are taken using WP 3.6.1, menu admin page changed in WP 3.6, so if the yours appear differently is because you have an older version installed.

The workflow described in answer can be done with older version too, but I recommend you, as usual, to keep your WorpPress updated.