Simple Yearly Archive Plugin// Making Archiving Easy & Elegant

Simple Yearly Archive is a rather neat and simple WordPress plugin that allows you to display your archives in a year-based list. It works mostly like the usual WP archive, but displays all published posts seperated by their year of publication. That said, it’s also possible to restrict the output to certain categories, and much more.

The plugin in action
The plugin requires WordPress 3.7+

  1. Download the plugin and unzip it.
  2. Upload the folder simple-yearly-archive/ to your /wp-content/plugins/ folder.
  3. Activate the plugin from your WordPress admin panel.
  4. Installation finished.

  1. Deactivate the plugin from your WordPress admin panel.
  2. Upload the folder simple-yearly-archive/ to your /wp-content/plugins/ folder and overwrite the existing file.
  3. Activate the plugin from your WordPress admin panel.

Implementation / Usage

Since WordPress 2.5 the function can be called with a shortcode:
Some examples follow - each is a proper invocation of the plugin:
[SimpleYearlyArchive type="yearly_past"]
[SimpleYearlyArchive type="1249077600-1280527200"]
[SimpleYearlyArchive type="yearly" exclude="22,11"]
[SimpleYearlyArchive exclude="22,11"]
[SimpleYearlyArchive include="10,11"]
[SimpleYearlyArchive dateformat="%d/%m"]
[SimpleYearlyArchive posttype="my_product"]
Call the simpleYearlyArchive function like so:
simpleYearlyArchive('type', 'ExcludeCategoryIDs', 'DateFormat');
Some examples follow - each is a proper invocation of the plugin:
simpleYearlyArchive('yearly','','', 'my_product');
Parameter options are like following:

  • type (defaults to 'yearly'):
    - yearly: Displays a year-based list (Default). Can be empty aswell.
    - yearly_act: Only posts from the current year are displayed.
    - yearly_past: Only posts from the past years are displayed.
    - "date of year": Only posts from the given year are displayed.
    - "<unixtime-from>-<unixtime-to>": Only posts from the given (unix)time period are displayed.
  • ExcludeCategoryIDs:
    - A comma-separated list of category IDs you want to exclude.
  • IncludeCategoryIDs:
    - A comma-separated list of category IDs you want to include.
  • PostType (defaults to 'post'):
    - A registered post type to show.
  • DateFormat:
    - The date format string, according to

In order to run your blog proper and clean code, it's highly recommended to check if a plugin exists before calling it. If the plugin is not activated, it will "break" the theme and it may report errors or fail to load. It is therefore imperative to prevent the plugin from being detected in case it is turned off:
[php]if (function_exists('simpleYearlyArchive')) {

Options menu

There are a couple of options in the Simple Yearly Archive options menu.

  • Date format:
    The date output be customized. Check for date formatting.
  • Seperator between date and post title:
    The seperator is displayed between the date and the post title.
  • Linked years?:
    Wanna have the years linked?
  • Before / After (Year headline):
    HTML tags, that will be inserted before and after the date headlines.
  • Show post count for each year?:
    Show the total post count behind for each year?
  • Show comments count for each post?:
    Show comments count behind each post?
  • Show categories after each post?:
    Show categories behind each post? The output can be styled with the CSS class sya_categories.
  • Show optional Excerpt (if available)?:
    Show the optional excerpt below each post title, if available?
  • Max. chars of Excerpt (0 for default):
    How much chars of the excerpt to show? Enter 0 to show the entire excerpt.
  • Indentation of Excerpt (in px):
    How much pixels the excerpt should be indented.
  • Link back to my website in plugin footer?:
    Consider linking back to my homepage in the plugin's footer.


952 Responses

  1. Hi ! Thanks for this useful plugin.
    This shortcode with include categories don’t run :
    [SimpleYearlyArchive type="yearly" include="60,52" order="DESC"]
    This shortcode without categories run correctly :
    [SimpleYearlyArchive type="yearly"]

    In the shortcode above 60 and 52 are categories IDs. Isn’t it ?

    I don’t understand.
    My blog is running under WordPress 3.3.1
    Simple Yearly Archvie Version 1.4.3

    • Do you get any errors? I’m not sure the plugin still works with WordPress 3.3.1. We’re at 3.6 already. 😉

  2. Thank you for your reply.
    The reason of the problem was a conflit with settings of an other plugin (Advanced Category Excluder Widgets). This is my fault …
    In fact, there is non problem with WordPress 3.3.1. But I upgraded it , by the way.

  3. The updated plugin started showing both drafts and private posts in my archives, which freaked me out. When I updated it again, it stopped working. When I call the shortcode listed above it breaks the theme. What happened to this perfect plugin? 🙁

  4. Hey,

    well, if you’re okay with sending me a login to your WP site so I could see myself, that’d make things a lot easier for me to check. 🙂 If you’re okay with it, please send the credentials to scripts (at) schloebe (dot) de

  5. Hi Oliver, thank you so much for the great plugin but I have two questions:

    1.- The first question and the more important is that when I install SimpleYearlyArchive Plugin, enter in conflict with Top Commentators Widget Plugin, SimpleYearlyArchive Plugin working perfect but Top Commentators Widget Plugin stop working.

    2.- How I do a page with SimpleYearlyArchive Plugin for the catgories?

    Here my link archives:

    Thank you Oliver 🙂

      • Hi Oliver, and the first question please? you have a posible solution?

        My second question is because when I see the section “Implementation / Usage” I not see nothing of catgories, sorry and thanks.

        • Hey,

          just tested the Top Commentators Widget Plugin while Simple Yearly Archive was activated, and both plugins work just fine for me. Maybe another plugin is causing the issues?

          Regarding your second question. Use this code:

          [SimpleYearlyArchive type="yearly" exclude="x"]

          where x is the ID of the category you don’t want to show.

  6. Hi,

    Great plugin! I have a question? Can I define what a year means?
    For example I want to archive posts from september 2013 to August 2014 and so on….like a school year.

    Thanks in advance

      • Hi Oliver,

        Thanks for your reply Oliver! Is there a quick fix on your code, where i could possibly change what you retrieve as results? For example instead of if year = XXX to get results between september and august or something like that? Is there a fast work around?

        • Well, as you can see here the list is separated by year… what’d be the seperator if you choose to use results between september and august? That’d pretty much be a monthly archive, so I’m sorry to say there’s no quick workaround I can think of.

  7. Hi Oliver,

    thank you for this great plug-in.
    It works very well and it looks as simple and great as I could wish for!

    One question:
    Is there a maximum number of posts the plug-in can handle?
    Right now, there are 646 posts altogether and most of them are in the archive. The archive is not shown when the shortcode is included in its basic version.
    But it is shown, when “yearly_past” is added.

    This is the site:

    Thank you for your kind attention!

          • Hi Oliver,

            thanks for your reply (I cannot answer to your last reply so this is why I answer here).

            Regarding your question:
            Yes, the plug-in is called on the page, it is just the amount of posts that is different between the two versions I sent you. Everything else is the same.

            – on the site /ACHIV I use “[SimpleYearlyArchive type="yearly_past"]”
            – on the site /TEST I use “[SimpleYearlyArchive]”

            So I am still pretty sure that your initial thought, a memory limit, is the reason for the problem.

            Is there a possibility to increase the maximum number of posts (=the memory limit you were mentioning before) the plug-in can handle?

            If that is not possible: how could I leave out only posts from earlier years? (type=”…”)

            Maybe I can send you the log-in data so that you can take a look?

            Sorry for bothering you again, your help is appreciated a lot!

            Thank you!

  8. Hi, thanks but I encounter the following Notice: Undefined variable: listyears in /home/…/public_html/…/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 251

    When using exclude/include parameter, only

    Any idea how to fix it?

  9. Really thank to you Oliver for this quick reply and 😉 upgrade

    but for now there is the following notice
    Notice: Undefined variable: listyears in /home/…/public_html/…/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 277

    I’m using [ SimpleYearlyArchive include=”23″ ] for example, then in fact 1rst year list is right, but next there are posts of these 2 years, it should show only posts of 2d year, etc

    Good luck

  10. Hi, thanks for the awesome plugin. I have a little problem with it. When I click on the year then it expands my news list, I choose the news and go to read it and now if I go back to the news list (just going back) then the news are not expanded anymore and I have to click again on the year number. How to change that so, that if I come back from reading then the news list are still expanded?

    • I know it can be kinda cumbersome, but I’m intending the plugin to be as lightweight as possible. Most people open links with their middle mouse button anways, which opens links in a new tab/window, so when they close the new tab, they’re on the archive page again. 🙂

  11. Hello!

    I’ve used this plugin for several years on a site I manage. Now I’m relaunching the site—building from scratch—and hoped to continue using it. But when I paste the shortcode into a page, not only does it not display the archive, but it also removes my footer and sidebar. I disabled the other three plugins I’m using and it didn’t help. Any ideas? I’ve upgraded to the latest release of both the plugin and WordPress.


  12. Hello Olivier, thanks a lot for your plugin. I have just started to use it today and it seems like i have a problem. The plugin is not showing all of my post just the ones that apparently have a certain category (its in spanish but for example the plugin is just showing the post that have the “Documents” category). I have created a static page and im using this shortcode : [ SimpleYearlyArchive].

    I will really appreciate your help.

    • It should be showing all your posts if you don’t have a parameter given in the shortcode. May you please give me a link?

  13. I can’t get any exerpt to show only title. I use WordPress 3.8 and theme Twenty Thirteen. Nice plugin!

    • The plugin lists the post titles by default, no need to enable excerpts display. Or what do you mean?

      • I mean that it would be nice to see short exerpt in a list below every title. I thought that is possible because you have an option for that in a settings page.

  14. Two things:

    1. Does it support pagination? Or is everything displayed on one page?

    2. Is it possible to include the first attached photo of each post as a thumbnail?

    Thank you.

    • Hi Mathew,

      1.) No, a single-page archive will be generated.

      2.) Well, I’m not sure if this would break the clean nature of the plugin. What do you think?

  15. i need post date sunday 27th and want to archive posts from september 2013 to August 2014 on years please help me for that thing
    that plugins help for me

      • Hallo Oliver

        Gibt es eine Möglichkeit, in einer der Dateien des Plugins die gewünschte Zeitspanne von Hand einzutragen?

        Ich wäre sehr daran interessiert, da ich mein Archiv in “Schuljahre” gliedern möchte.

        Danke jetzt schon für eine Antwort und vielleicht sogar Hilfe.


        • Hallo hama, das ist leider nicht so einfach, wenn auch nicht unmöglich. Du müsstest den Query quasi insofern anpassen, dass du ein Startdatum als Unix Timestamp nimmst (z.B. September 2013), dann 12 Monate drauf rechnest und dann in der Query “SELECT post_date BETWEEN AND ” abfragst.

          • Hallo Oliver

            Würde ich das anstelle von:
            $_query[] = ‘AND YEAR(post.post_date) = “‘ . intval($aktuellesJahr) . ‘”‘;

            Hmm, ich nehme an, es ist (leider) aufwändiger und somit für mich persönlich nicht realisierbar, da zu wenig PHP-Kenntnisse vorhanden sind.
            Gibt es eine Möglichkeit, dich in dem Sinne anzufragen, ob du mir diesen Hack schreibst (inkl. “donate”) oder ob du das evtl. sogar als zusätzliche Auswahlmöglichkeit in dein Plugin einbaust. Dies könnte allenfalls eine “Marktlücke” sein, da ich bis jetzt kein einziges Archiv-Plugin gefunden habe, welches die Auswahl der Daten über die Jahre hinaus bietet.

            Liebe Grüsse


            • Hallo hama,

              ich möchte mein Plugin ungern aufblähen mit Features, die vllt. 1% der Nutzer nutzen würden.

              Was ich mir aber vorstellen könnte, wäre, daraus ein eigenes kleines Plugin zu machen, ggf. mit weniger Optionen als sein “großer Bruder”. 🙂 Das Problem, welches ich nur sehe, ist, dass jedes Schuljahr ja anders stattfindet jedes Jahr, d.h. das Plugin kann nicht jährlich davon ausgehen, dass die Zeitspanne vom 1.1. bis 31.12. geht. Es wäre also quasi weniger automatisch, und man müsste für jedes Schuljahr manuell eine eigene Seite anlegen, mit dem passenden Shortcode drin, der Start- und Endmonat vorgibt.

              Ich schau mal, ob ich das irgendwie ins Plugin einbinden kann, ohne die Mehrheit der Nutzer zu verwirren. 😉

              • Hallo Oliver

                Es kann grundsätzlich immer die gleiche Zeitspanne für die Schuljahre definiert werden:

                01.08. bis 31.07.

                Klar sind die letzten Wochen im Juli und die ersten Wochen im August Ferien, was jedoch keinen negativen EInfluss auf das Archiv haben würde.

                So ein Mini-Plugin für diesen Zweck wäre natürlich voll cool … 😉

                Liebe Grüsse


              • Lieber Oliver

                Konntest du vielleicht schon etwas bewerkstelligen mit der Archiv-Zeitspanne 01.08. bis 31.07.?



              • Hallo hama,

                leider komme ich im Moment zu nix wirklich, was mit WordPress zu tun hat. Zu viel zu tun im Job. Ich hoffe, ich kriege das diesen Monat noch hin. 🙂

              • Hallo hama, Version 1.7.0 hat nun die Möglichkeit, eine eigene Zeitspanne zu vergeben. Über den Shortcode sähe das z.B. so aus:

                [SimpleYearlyArchive type="1249077600-1280527200"]

                Die beiden Zahlen sind von-bis UNIX timestamps, die man z.B. hier generieren kann:

                Nicht optimal, aber so musste ich keinen weiteren Parameter einführen, der andere Nutzer verwirrt, die die Funktion nie nutzen. 😉

              • Hallo Oliver

                Vielen Dank, das hat perfekt geklappt. Ich hab’s schon eingebaut. 🙂

                Cool, dass du extra ein Update gemacht hast!

                Liebe Grüsse


  16. Hi Oliver,

    great and easy to use plugin. Thanks. One question: is it possible to add custom post type articles to the archive?

        • Hey Steffen, would be possible but isn’t creating post types aiming to separate posts from the normal ones? Why list the normal posts along with the custom post type posts? Wouldn’t categories be better for that matter?

          • Thanks Oliver for your answer. I was pretty sure to do sth good. But you are right. Everything can also be done in categories instead of custom post types. So I could solve this this way. Thank you.

  17. Hallo Herr Schlöbe,
    erst mal vielen Dank für das tolle Plugin. Ich hätte einen erweiterungsvorschlag für das Design. Leider weiss ich nicht wie ich dies lösen könnte.
    Ich würde gerne alles im jquery oder jquerymobile style anzeigen.
    Anbei ein Link zu einer Demo wie ich mir das vorstelle, jedoch natürlich ohne funktion.
    Vieleicht könnten sie dies in ein Update einbringen oder vieleicht mir sagen wie ich es lösen könnte.
    Nochmals vielen Dank

  18. Hallo Richard,

    es bedarf sicherlich einiges an CSS-Knowhow, aber dieses Layout lässt sich jetzt schon mit CSS umsetzen. Jedes Element meines Plugins hat spezifische CSS-Klassen und -IDs, die man dafür ansprechen und nutzen könnte. 🙂

    • Guten Abend Oliver,
      vielen Dank für die rückantwort. So wie es tönt konnte ich dich nicht für ein grösseres Style-Update begeistern und überzeugen 😉 Leider habe ich kein wissen in css und bis ich dies gelernt habe sind wir bei WP version 10 angekommen 🙂
      Ich lass mich mal überraschen, vielleicht gibt es ja noch Heinzelmännchen oder ein tolles Oster-Weihnachtsgeschenk

      • Das Problem ist, dass ich das Design nicht vorgeben kann, da jedes WordPress Layout anders ist. Bei dir mag das Aussehen wie bei jQuery Mobile passend aussehen, aber bei einem anderen Theme würde das vllt. seltsam aussehen. Deswegen kann ich nur die Mittel mit den Weg geben, damit sich jeder die Ausgabe des Archivs seinem Desihn anpassen kann. 😉

        • acho ist das…
          kannst du mir evt noch einen hinweis geben mit welchen dateien ich mich da beschäftigen muss. Nur mit der css datei oder auch mit den allgemeinen php dateien deines Plugins?
          Nochmals vielen dank für deine bemühungen

          • Nur mit der CSS-Datei deines Themes (style.css). Die erforderlichen CSS-Klassen bringt mein Plugin von alleine mit.

  19. Hallöchen,
    Das Archiv als Seite sieht ja ganz gut aus… Aber kriege ich das ganze auch irgendwie in einem Widget untergebracht, quasi als Ersatz für das normale Monatsarchiv-Widget in der Sidebar? Oder wäre dafür ein weiteres / anderes Plugin nötig?

    (kann gut sein, dass ich mal wieder den Wald vor Bäumen nicht sehe…)

    • Hallo Rafael, ein Widget gibt es nicht. Allerdings gibt es einen kleinen Trick:

      1.) In der functions.php deines Themes folgende Zeile einfügen:

      add_filter('widget_text', 'do_shortcode');

      2.) Ein Text-Widget erstellen und dann einen Shortcode des Simple Yearly Archives eintragen, z.B.

  20. Mark Louie EspedidoApril 9, 2014 at 11:47 am

    Just the plugin that we need! Is there a way to pull and sort by date from a custom field?

  21. Hello!

    Suddenly, maybe since the last automatic update?, the plugin isn’t working for me anymore 🙁
    It just says: “Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 93510 bytes) in /customers/c/f/8/ on line 417”

    What can I do to make it work again?

  22. Hi, I’m having trouble with the exact notation of the shortcode. If I want to exclude category id3, i guess I the following shortcode, but it still shows all categories: [SimpleYearlyArchive ExcludeCategoryIDs="3"]

  23. Lieber Oliver Schlöbe,
    ich versuche vergeblich, das Plugin auf einem Blog meiner Multisite zum Laufen zum bringen. In ein Widget im Blog-Sidebar habe ich [SimpleYearlyArchive type="yearly"] geschrieben, aber nichts tut sich (außer dem Plugin-Footer, den ich zu Kontrollzwecken aktiviert habe). Beiträge sind ausreichend vorhanden, das WP-Standardarchiv zeigt entsprechend eine lange Liste an. Habe ich etwas übersehen? Oder gibt’s ein Multisite-Problem?

    • Hi, ich bin mir im Moment nicht sicher, ob Shortcodes in Widgets standardmäßig unterstützt werden. 🙂

  24. Hi Oliver,
    es gibt ja nun einige Optionen, was man je Archiveintrag an zusätzlichen Infos einblenden kann.
    Kategorie, Kommentaranzahl, Excerpt, Autor, etc. Aber was ich vergeblich suche und eigentlich genial fände, wäre das Featured Image je Eintrag unter dem Titel einblenden zu können (mit entsprechender Möglichkeit die Größe zu wählen).

    Leider bin ich nicht im Stande das selbst zu realisieren. Aber vielleicht ist das eine willkommene Anregung für die nächste Version?

    • Hi Tom,

      ich hatte die Anfrage schon öfter, habe mich bisher aber dagegen entschieden, denn der Pluginname “SIMPLE Yearly Archive” soll Programm bleiben. Mit Featured Image wäre es keine einfache Jahresliste der Beiträge mehr, sondern fast schon ein eigener Loop (also Post Listing).

      • Hm, kann ich verstehen aber da optional wäre es ja nicht sonderlich hinderlich. Aber klar, Entscheidung liegt hier ganz klar bei dir.
        Schade. Danke für die schnelle Rückmeldung.

        • Hi Tom, generell ausschließen möchte ich es nicht, aber bisher schreckt mich die Ausgabe etwas ab. 🙂 Nimm z.B. mein Archiv: Würde ich dort Bilder mit anzeigen lassen, dürften die entweder max. 30px hoch sein, damit sie vor jeden Eintrag passen, oder es sind dann dort große 100x100px Thumbnails, die die Liste immens vergrößern, denn es gibt ja nur die Überschrift zum Anzeigen. Für mich passt das irgendwie nicht zum Konzept des Plugins, daher habe ich mich bisher dagegen entschieden.

          • Wenn du dir meine Header-Images anschaust, dann siehste warum ich das gerne hätte 😉
            Würde das lange Image gerne unter dem Titel jedes Posts haben… nur hab ich keine Ahnung wie ich das selbst realisiseren soll…

              • Hi Oliver, habs gerade installiert und eingestellt und siehe da, funktioniert und zwar so wie ich mir das dachte 🙂 Perfekt!
                Ich seh jetzt zwar die Probleme die du angesprochen hast, aber dennoch denke ich, das es bei einem visuellen Blog wie meinem hilfreicher ist, die Bilder zu sehen als nur die Überschrift. Von daher, ich bin sehr zufrieden und danke dir vielmals! 🙂 Kann ausgerollt werden! 😉

  25. Can I just say what a comfort to find a person that actually knows what they are discussing over the internet. You actually understand how to bring a problem to light and make it important. More people ought to read this and understand this side of the story. It’s surprising you aren’t more popular since you certainly possess the gift.

  26. There is certainly a lot to find out about this subject. I like all of the points you’ve made.

  27. Hi,
    I would like to display only the years along with the number of posts in parenthesis but not the post titles per year. Is this possible?

      • Hi Youda,
        thanks for the code you provided. I tested it and unfortunately it does not work. I get a fatal error message when changing the code. Are you sure it’s right?

        • Hi guys, the problem with the code is that while Simple Yearly Archive allows to filter the archive list for multiple category IDs, WordPress doesn’t. So when someone includes the categories 1,3,5, and clicks the Year link, it won’t work. The link would look like /2014/?cat=1,3,5 but WP does only allow single category filter IDs, so it would filter the list to category ID 1 only and the list wouldn’t be accurate nevertheless.

          • Hi Oliver. Thanks for your answer.
            I have 3 post categories. My purpose is to get all the posts of each category (not from multiple) for each year for e.g. 2014 with cat id ’12’.
            The problem is that i get the posts of 2014 from all the categories instead of only “12”. The code of Youda didn’t help also. I work in wordpress 3.9.1.

            • It works for me. I know that it doesnt wokr for mulitple but i am not usiong it. Maybe Oliver could help you. I am not a web developer and i just changed what i needed. i know it isnt done in proper way.
              try changing the right line.

              • oh i dont know why but “” changed the braces from round to square. of course they need to be round. I think you just need to find out what URL works on your web. For me “/2014/?cat=100” works so my code alse works.

    • Hi miguel, use the include parameter, e.g.

      [SimpleYearlyArchive include="10"]

      where 10 is the category ID.

  28. federal government liability for torts of its employees during the course of employmentOctober 26, 2014 at 1:43 pm

    Hi, I do think this is a great site. I stumbledupon it 😉 I will return yet again since i have book marked it. Money and freedom is the best way to change, may you be rich and continue to guide other people.

  29. Hi,
    Thanks for this plug in.Its really good one.
    I need to display year wise category list like 2014 2013 2012 … etc.
    But i am using short code like this [SimpleYearlyArchive type="yearly_past" include="2" ] and [SimpleYearlyArchive type="yearly" include="2" ]
    It shows like 2012 2013 2014.
    I need present year is first .

      • Thank you,
        Yes i updated the settings now its working perfectly.
        But still i am having one problem when i am using [SimpleYearlyArchive type="yearly" include="3"] this short code all list will be displayed perfectly, But that list shows when user logged in to the site only.
        If we are visiting site that list are not displaying properly,it shows only present year

  30. Thank you for your reply. I checked that one Reverse order is enabled.
    But still i am having some other problems.
    when i am using this short code [SimpleYearlyArchive type="yearly" include="3"] its displaying values will be correct but it showing when we logged in to the site that time only shows exact out put. But without logged in its not displaying all values shows only present year.

    • Hey Venu, having different output for logged in and logged out users sounds like a Cache issue. Do you happen to have a cache plugin installed that could cause different output for not logged in users (i.e. outdated cached output)?

  31. Is there an issue if this plugin is used on more than one page in a site? I set up the shortcode on a single page with this:
    [SimpleYearlyArchive include="24"]
    and it worked perfectly. Here’s that page:

    Then when I tried to recreate it with another ID on another page, it displays other categories. For instance, category 27 only has 1 item. This is the shortcode:
    [SimpleYearlyArchive include=“27"]
    but the page displays posts from many categories. Here is the other page:

    Any idea why this would happen?

    Thank you

    • Hi Gino, there’s no problem when using the plugin on more than one page.

      One thing to consider is that the plugin does not only show posts that are associated to a particular category exclusively, but also if the category selected with include=”27″ is IN the list of associated categories for a post.

      Also, is category 27 a parent category with child categories?

      • No, we have no child categories at all. Category 27 only has one post so far, so shouldn’t only one archive link appear?

        Maybe I don’t understand how the plugin works, but then why would it work on one page and not others?

        • Please disregard my previous post. For some reason it is working correctly now. I’m not certain, but I think I may have made an edit, then clicked Preview page, then made an edit to the PREVIEW page and not the actual page that was open in another tab. So, the plugin works like it is supposed to. I’m just careless. 🙂

  32. Is there a way to default load only the current year and load other years when a user clicks the link for that corresponding year?

    • Hi Mike, you could create several pages and add shortcodes to the content like for the current year: [SimpleYearlyArchive type="yearly_act"] For other years create specific pages like “Archives: 2014” and add the shortcode [SimpleYearlyArchive type="2014"] etc.

      • Follow-up question: Is there a way to show in a single archive page the posts of a subset of years (like 2013 AND 2012 AND 2011) or pick a year and display all posts in that year AND all posts in years previous?

        Thanks again.

        • Hi Mike, there is. Try [SimpleYearlyArchive type="unixtimefrom-unixtimeto"]. For 2011 through 2013 this would be [SimpleYearlyArchive type="1293836400-1357081199"]

          For more information have a look at the “Implementation / Usage” section above.

  33. Hi, I’m having a little language problem when displaying short month names. Do I call SYA by a shortcode in a page everything is fine. When I call SYA by PHP in order to add an archive to a particular page the month names are in english?!? The whole site is set for german. What am I doing wrong?

    thanks for your help

  34. I cant seem to work this plugin in my page. i think im missing something. how can i put this in one of my pages. my wordpress version is 4.1.1 thanks

  35. Hey Oliver,

    Thanks for a great plug-in and for maintaining it.

    The new customizable date field makes no sense to me. I’ve read through the linked file about the date string, and I can see the variables I want to use, but no matter what I enter into the field all I ever get on the front-end is %x where the date should be. What am I doing wrong?


  36. Oh, wait. Disregard. I figured it out. My Cache plug-in was keeping me from seeing the changes rendered. Thanks!

  37. Quick question – is it possible to manipulate the excerpt settings via shortcode? We use the plugin on a number of pages and we don’t want excerpts on all those pages. Thanks!

    • Hi Chris, you cant manipulate setting, but you could hide the excerpts on specific pages via CSS.

  38. A feature that would be cool: have an option to have the categories (when shown) “clickable” to go the specific category archives…

  39. Hi! This is great, but I seem to be having a problem. [SimpleYearlyArchive] doesn’t work in my Archives page. Nothing shows up at all. But if I use the shortcode [SimpleYearlyArchive type="yearly_past"] it works fine. But I want to use the first one so I can also include this year in the archives. Not sure what the problem is! Any help you could give me would be appreciated! Thanks.

    • Hallo Andreas, das Aussehen lässt sich natürlich per CSS anpassen; darunter ist auch die Möglichkeit, die Aufzählungspunkte auszublenden.

  40. Hi Oliver,

    I love your Simple Yearly Archive plugin! I wonder if the plugin is stripping html from the excerpt field, and if so can I make it not do this?

    I installed a plugin called Advanced Excerpt [ ] so that I can link to articles and PDFs in the excerpt. The links show in a normal WordPress post archive, but not on my Simple yearly Archive listing. My page is

    Thank you,


    • Hi Suzana,
      sorry for the late reply! Well, for the excerpt output I’m using the built-in WP function the_excerpt() which strips HTML by default. The plugin author of “Advanced Excerpt” does state that himself: “Why do I need this plugin? The default excerpt created by WordPress removes all HTML.”

      The problem why it may not be working with my plugin might be that the “Advanced Excerpt” plugin is only compatible up to 4.0.7 and was last updated almost a year ago. I’m not exactly sure but since we’re at WP 4.3 already, there might be a lot that has changed in the API that plugins utilise.

  41. العاب بنات تلبيسSeptember 21, 2015 at 5:52 pm

    A fascinating discussion is worth comment. I believe that you need to write more about this subject matter, it may not be a taboo subject but usually folks don’t discuss such subjects. To the next! Cheers!!

    <a href=""العاب بنات تلبيس

  42. Hi there, great plugin, slick, simple, fast. Yet I wonder: is there a way to add a html code (like a br or hr) after every entry. Since the preview image is so close to the next month / date, it is a bit confusing. Especially in what appears to be a very long list / page. I also would love to have a pagination, but as I read here, it is not possible nor planed to be implemented. This would make this plugin not just good but perfect.

    Thank you in advance for your answer and support.


  43. Hello Oliver,

    I’m not sure what options I need to check in order to show the year in collapsed form (like in your demo). I have tried many combinations.

    I’m using the shortcode [SimpleYearlyArchive] and always get all years in expanded form with all post visible.

    WP 4.4

    Thanks in advance.

  44. Hallo Oliver,

    habe das Plugin Installiert und auch eingerichtet. Nur leider komme ich bei Datum nicht weiter. Und nach dem Speichern wie kann ich das Archiv aufrufen unter /archiv finde ich nichts.

  45. Hallo Oliver,
    ich habe bei meinem Archiv immer einen Zeilenumbruch nach jedem Aufzählungszeichen. Ich hab schon in den CSS Dateien gesucht, aber nichts finden können.

    Danke für das klasse Plugin.

    Gruß, Michael

  46. Hi Oliver, ich möchte gerne im Archive die Jahre als Hauptauswahl anzeigen, darin dann die Monate. Im Hello Oliver, kann ich das im Simple Yearly Archive Plugin einstellen wenn ja wie? Habe schon alles probiert, es erscheint immer Auswahl nach Monat. Ich hätte gerne Auswahl nach Jahr.

    Gruß Helmut

  47. Genau was ich gesucht habe! Danke.

    Leider erhalte ich nach Aktivierung folgender Fehler:

    Warning: Creating default object from empty value in /***/wp-content/plugins/simple-yearly-archive/simple-yearly-archive.php on line 181

  48. Just started to receive 500 Error, any suggestions where to start troubleshooting?

    I have tried different variations using the shortcode but everything is coming up 500.

  49. Hi,
    I’d like to use this to display my reading list for each year (1 post per book with cover as featured image).
    While I can filter to display only the correct category for a specific year, I’d like to:
    1) hide the post titles and only show the book covers as thumbnails
    2) display it as a grid, instead of having only one image per line
    Is that possible?

    • Maybe there are other (more efficient?) ways to do it, so any feedback would be welcome, but for now I’ve played a little bit with the CSS and have been able to display the grid as I wanted.
      Here is what I added to the CSS:
      #sya_container ul {
      list-style: none;

      #sya_container ul li {
      display: inline-block;
      vertical-align: middle;
      margin: 0 5px 5px 0;

      .sya_postcontent {
      display: none;

      .sya_postimg {
      float: left;

      You can see how it looks on my site:
      Instead of creating multiple pages (one for each year), I’ve decided to keep it all on a single page, at least for the time being. It’s possible to add links to a specific year anyway, just as with the “anchored overview” on top of the page.
      Thanks for that nice little plugin.

  50. I’d like to create an archive page for my site, Your plugin seems best, but – I can’t get it to work. I run WordPress 4.5.2. I installed SimpleYearlyArchive, but I can’t get it to expand the years to display the posts by month. I got it to do this just once, and ever since it just gives me a year, with a link, with a count, but it won’t expand the link to display the posts. Can you suggest what I may be doing wrong? Here’s my configuration:

    Date format is M-D
    Collapsible Years is checked
    Anchored Overview is checked
    Show post count for each year is checked
    Reverse order is checked
    Separater and Before | After are as they default (what is the “Before | After” anyway?)

  51. Hallo Oliver,

    ich nutze dein Plugin und finde es sehr gut. Habe es mir aber so umgeschrieben, dass die Ausgabe nicht als Liste erfolgt, sondern als Tabelle. Das hat den Vorteil, dass Artikel mit einem langen Title nicht unschön umbrechen und sich mit dem Datum vermischen. Mit Tabelle sieht es viel ordentlicher aus. Problem ist aber, dass wenn jetzt ein Update kommt, was gerade geschehen ist, meine Änderungen futsch sind und ich es immer wieder anpassen müsste. Daher meine Frage, ob Du nicht auch so eine Option integrieren könntest -> Ausgabe als Tabelle. Das wäre ziemlich genial. Dann könnte ich mir das Anpassen sparen und wäre auch updatekompatibel. Und ich denke für viele wäre eine Tabellenausgabe auch interessant. Vielen Dank für alles!

    Viele Grüße

    • Hi Chris, kannst Du einen Link zu Deinem Archiv posten? Viele (wenn nicht sogar alle) Sachen kann man mit reinem CSS lösen, und ich habe mein Plugin mit vielen Selektoren ausgestattet, sodass man eigentlich jede Ausgabe mit reinem CSS erreichen kann, die man möchte. Ich kann mir das ja mal anschauen. 🙂

  52. First i want to thank you for making this plugin !
    But i have a problem to output posts of custom type made by another plugin called WP BLOG AND WIDGET – in debug mode i see “Trying to get property of non object”, so i tried to output “normal posts” with posttype=”post” and it work fine. I checked the db to compare and see differences between posts of normal type and custom posts type”blog_post” … there is no differences.
    Maybe any suggestions ?

    • Hi Mike, may you please post the entire debug message? It’ll be helpful in tracking down the issue. Thank you!

  53. Mauricio ArcehelizagaAugust 4, 2016 at 4:06 pm

    Hi Oliver, Thank you for your great plugin.

    I have a question, my client requires a page where there is a list of years on the sidebar and the posts for that year on the content area. With your plugin I can make the list of years, but is there any way that the posts for that year appear on the content area NOT in a new page?

    Thank you!

    • Hi Mauricio, that most probably requires custom coding as my plugin doesn’t cover that usage scenario.

  54. Hi Oliver, why I can’t list attachments?

    [SimpleYearlyArchive posttype="attachment"] returns me that no post was found.

    WordPress 4.5.4
    SimpleYearlyArchive 1.8.0


        • Hi Luiz, I already know what’s causing the issue. The issue is that for performance reasons I am grabbing the posts via SQL query from the table wp_posts. As attachments use another table, it won’t find any attachments. Plus, attachments use different functions to generate links and get attachment info compared to posts so I’d have to change quite a lot to make the plugin list attachments.

          Let’s see if I can get it to work though. 🙂

              • You are awesome, Oliver!
                But it still doesn’t work here..
                I upgraded both your plugin and WordPress to latest versions, but nothing 🙁

                My shortcodes:

                [SimpleYearlyArchive include="90" posttype="attachment"] <– shortcode with the attachment category ID, still returns me that no post was found.

                [SimpleYearlyArchive posttype="attachment"] <– without the ID, returns a list of many empty lines..

              • Hi Luiz,

                1. I think this is intentional. As attachments dont belong to categories directly, you cannot filter attachments by category.

                2. Did you add titles for your attachments/media items?

  55. Hallo Oliver Schlöbe,
    seit dem letzten Update auf Version 1.8.1 funktioniert dieses Plugin nicht mehr.
    Siehe meine Seite:, dort in der horizontalen oberen Auswahlleiste Archiv.
    Fehlermeldung bei Windows Edge: http-Fehler 500. Auch bei anderen Browsern funzt es nicht.
    Viele Grüße

  56. Hi Oliver,
    I’m using your plugin showing two custom post, but now I would need to show in the archive only the post of two specific custom taxonomies in my custom post. I did try to use the exclude or include parameters, but they seems to work only for the taxonomy category. I’m I right? is there a way to make the plugin work even with the custom taxonomies?
    in the code the fix should be here:

    or here

    I dind’t see other part but I could have missed them

    I did try to change the first part of the code with

    $allcatids = get_terms( array(
    ‘taxonomy’ => array(‘custom_tax_1′,’custom_tax2’),
    ‘fields’ => ‘ids’,
    ) );

    and the second part with:

    ($syaargs_includecats != ” ? $syaargs[‘custom_tax_1′,’custom_tax2’] = $syaargs_includecats : ”);

    But it didn’t work…the list it’s always empty. Could you please help me

    Thank you

    • Hi Kief,

      currently it’s only possible to show posts by custom post types like

      [SimpleYearlyArchive posttype="my_product"]

      and by including and excluding category IDs. Taxonomies are on my TODO, but I can’t tell an ETA at this time.

      • Hi Oliver,
        sorry to bother you again, do you have any news about the possibility to include and exclude taxonomies?

        • Hi Kief,

          you’re not bothering at all. 🙂 I’ve already started to implement the changes but I’d like to implement it a little more flexible than “just” allowing to exclude taxonomies but also allowing anyone to filter by any field more specifically. That’s why it’s taking quite a bit, plus I’m busy with my job, but I’m on it. Sorry I can’t tell an ETA still.

        • Hi Kief,

          I just released version 2.0.0 that allows to query for literally anything. For your specific needs try to add the following snippet to your theme’s functions.php:

          add_filter( 'sya_get_posts', function() {
          	return array(
          		'tax_query' => array(
          			'relation' => 'AND',
          				'taxonomy' => "custom_tax_1",
          				'operator' => 'EXISTS'
          				'taxonomy' => "custom_tax_2",
          				'operator' => 'EXISTS'

          Let me know if there’s any issues. 🙂

          • Hi Oliver,
            I did try but probably I missed something. This is what I try to achive:
            I’ve 2 custom post type: eventi and mostre, and for each I’ve created a custom taxonomy, respectively “tipo-evento” in “eventi” and “tipo-mostra” in “mostre”. Inside “tipo-evento” there are 3 taxonomies: “archivio”, “corso”, “prep” and something similar in the tax “tipo-mostra”.
            I need that the archive calls only the posts in the “archivio” for both eventi and mostre.

            This is what I tried:
            – I updated your plugin;
            – I added the snippet in the function.php, changing the “custom_tax_1” in “tipo-evento” and “custum_tax_2 in “tipo-mostra” ;
            – I wrote the shortcode in my page [SimpleYearlyArchive include="ID of "archivio" in "tipo-mostra",ID of "archivio" in "tipo-evento"]

            When I open the page the result is “No article found”
            What I did wrong?

            • Hi kief, first off, try to just use the shortcode


              as everything else will be handled by the snippet I posted earlier. If that doesn’t help, we’ll dig deeper. 🙂

  57. Hi Oliver,

    Do you maybe have a suggestion how to create a “simple-monthly-archive” instead of a yearly archive? Could I somehow change any settings in your plugin or are you aware of another approach?

    Thank you in advance.

  58. Hi Oliver,
    Any chance to show the tags next to the post?
    Currently I only see the option “Show categories after each post?” in the Settings.

  59. Hello Oliver,

    Thanks for your excellent plugin. It does exactly what I want, but I’m having a problem setting it up. I’m new to WordPress design and am developing my first site in a localhost Xampp environment. I wonder if the localhost environment is causing my problem:

    I use this shortcode to avoid displaying current-year 2017 posts:
    [SimpleYearlyArchive type="yearly_past"]

    Linked years: YES
    Collapsible years: (no)
    Show post count for each year: YES
    Show categories after each post: YES
    Show tags after each post: YES

    My Archive page displays as appears in this screen capture image:

    Posts are listed below each year, but I don’t want the posts to be visible until the visitor selects an individual year link. I realize I should select “Collapsible years” but that is not working for me. Read on…

    I want my Archive page to display as yours does in your Archives demo at this URL:

    In your example, each year is an active link with the number of posts in parenthesis at the right. Selecting the year link displays the individual post links below that year as a heading.

    If I adjust my SETTINGS as shown below, the data displays incorrectly as appears in this screen capture image:

    And the year links do nothing when selected; no posts are displayed and nothing changes.

    Linked years: (no)
    Collapsible years: YES
    Show post count for each year: YES
    Show categories after each post: YES
    Show tags after each post: YES

    Please advise as to how I can format the data the way you did on your Archives demo.

    • Hi Tom,

      your comment was pending moderation as it included several external links so you couldnt get to see it after submission but it didn’t get deleted – obviously. All good. 🙂

      As for your issue: The reason it displays as shown in might be CSS related. You may have set headlines like h1, h2, h3… etc to display: inline. Can you confirm?

      2 more questions to get started:
      1. What’s your setting for “Before / After (Year headline)”?
      2. Do you happen to have an ad blocker running that may block some scripts?

      If you prefer to continue writing via email, my email is scripts (at) schloebe (dot) de
      I’m sure we’ll get this one solved. 😉

  60. Thank you, Oliver.
    I will try sending email to you directly, due to my localhost limitations and the need for screenshots at external links.

    • Hi kief,

      I think I managed to make up a solution. 🙂

      1.) Use the following shortcode:

      [SimpleYearlyArchive posttype="mostre,eventi"]

      2.) Replace the existing snippet in your functions.php file with the following snippet:

      /* aggiungere taxonomy archivio */
      add_filter( 'sya_get_posts', function() {
      	return array(
      		'tax_query' => array(
      			'relation' => 'OR',
      				'taxonomy' => "tipo-mostra",
      				'field'    => 'slug',
      				'terms'    => 'archivio'
      				'taxonomy' => "tipo-evento",
      				'field'    => 'slug',
      				'terms'    => 'archivio'

      Let me know if this is working as intended. 🙂

  61. Hi there

    I love this plugin but I’m struggling to do what I want to. I need to show one list with only the active years posts and another list with all the archives in. the trouble for me is i don’t know if my code is working because i’ve only got two blogs, as yet. can you please help and let me know which specific code to use to do these two things please?

    denise x

    • Hi Denise,

      you should be good to go with

      [SimpleYearlyArchive type="yearly_act"]

      to display posts from the current year and

      [SimpleYearlyArchive type="yearly_past"]

      to display posts from past years. Let me know if this helped. 🙂

      • Just another query. I have a lot of blogs for each year. Is there a way to show them by month, so there is only every 12 links for each year and then the user can select the month and it opens out a link to show the blogs names and links to them?

        Denise x

        ps i’m really loving this plugin and will use it on so many of my sites …

  62. Hi, I noticed that you print out the module name and version as a HTML comment. This is a potential security issue, as it discloses some sensitive information from my point of view. How can I disable this behaviour? Thanks, Florian

    • Hi Florian, good catch! Printing the version info was actually due to support reasons for quickly getting the plugin version info but I’ll be issuing a plugin update later today that’ll remove that HTML comment. Thanks!

  63. Hi Oliver.

    I want to customize font-size, font-color, line-height, margin etc. of the heading of the year. How do I do it? Please give me some suggestions. Thank you for such a great plugin.

    • Oliver SchlöbeMay 2, 2017 at 8:57 am

      Hi Dang, you can do it with plain CSS. Just add the following to your theme’s style.css:

      .sya_container h3 {

      Change h3 to what you chose for “Before / After (Year headline)” in the plugin’s settings.

      • Would it be possible to add customization to the setting section of the plugin? I’m not quite familiar with CSS so…

        • Well, CSS is a quite powerful tool and adding each possibility of CSS as an option to the settings page would make the settings page huuuuge. 🙂

          What are you trying to achieve?

          • I want to be able to replicate to some extent this archive page just like on James Clear website ( I want to customize the heading (year) for ease of reading to my readers. Your plugin provides me with almost what I want. I just only need some more customization :).

  64. I, too, would like to customize some of the content settings. Mainly just font size. I added the above CSS code to my theme and it did not work.

    I added the following:

    .sya_container h3 {
    font-size: 16px;

    • Hi Alpesh, depends on your configuration. May you please provide a link to your archive page? Thank you!

  65. It is the first time that i’m using this plugin and i’m struggling to display yearly archive from a specific category with no luck.

    if (function_exists(‘simpleYearlyArchive’)) {

    where 215 is the category id. Unfortunately the plugin displaying posts from another category.

    Could you help on this?

    Thank you!

    • Hi audemedia,


      if (function_exists('simpleYearlyArchive')) {

  66. I am on the most current version of WordPress and I created a page with the following wording:

    Take a look at all the articles I have published so far.[SimpleYearlyArchive]

    When I preview my page I see a list of all the posts I have created but when I publish my page I see:

    “Nothing Found

    It seems we can’t find what you’re looking for. Perhaps searching can help.”

    What am I doing incorrectly?

    • Hi Charles, the wording of

      “Nothing Found
      It seems we can’t find what you’re looking for. Perhaps searching can help.”

      sounds like the 404 page of your template and the page you were publishing could not be found.

      Have you checked that Speaking URLs are enabled for your installation?

  67. Hi, How would I go about having the content in my archive page displayed by Month and then under each month, the specific titles of the articles that we published under each month?

    Many thanks Oliver!!

  68. Additionally, is there a way of archiving the content into categories in the Archive page? For example, we’d like to archive our category into four sections. 1. Interviews, 2. Weekly news updates 3. Research Posts 4. All others/assorted

  69. Hi!

    Thank you for this great plugin!

    How do I list child categories only after title? Can’t figure out that myself :/

    Thank You!

    • Usually they do, but depends on the used theme. May you please provide a link to your archive page? 🙂

      • Hi, this is my temporary site:

        Child categories are listed but I want to list ONLY child categories without their parents.
        For example year 2017 has entry “14.10.2017 – LapUA Ralli (F-Cup, Ralli)”. I want it to show only “14.10.2017 – LapUA Ralli (F-Cup)”.
        “F-Cup” is a child category of “Ralli.”.

        • Hi, alright, now I got it. Well, it wasn’t possible before but I just released a new plugin version 2.1.0 which I ask you to update to.

          After you’ve updated to version 2.1.0 please add the following code to (the end of) your theme’s functions.php file:

          function sya_child_categories( $sya_categories ) {
          return array_filter($sya_categories, function($v, $k) {
          return get_category( $k )->parent > 0;
          }, ARRAY_FILTER_USE_BOTH);
          add_filter( 'sya_categories', 'sya_child_categories', 10, 3 );

          Please let me know if that solves your request. 🙂

  70. Hi, How would I go about having the content in my archive page displayed by Month and then under each month, the specific titles of the articles that we published under each month?

    The way our current archive is can be viewed here:

    Many thanks Oliver!!

    • Hi Mathew,

      in the plugin’s settings page, may you please set the following values for the “Before / After (Year headline)” option:

      First input field insert <h3> and for the second </h3>

      Let’s see if that’s helping. 🙂

  71. I think the best option is do that:

    • 2017
    • September
    • October

    and after click on name of the month is collapse(you will see) list of all posts from this month
    i searching for that plugin and nobody did it, i think so… or i cant find it.

  72. hi, the plugin was working fine for a while but recently I get this error message when I click on the link to my archive

    Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0

  73. Hi Oliver
    Thank you for this great plugin!
    I have a question: how can i adjust the list so that the columns are nicely aligned?

    2010 (12)

    17 / 04 Post 1
    22 / 05 Post 2
    24 / 05 Post 3
    04 / 06 Post 4

    The problem is that with some fonts (Armata) the result will be like this:

    2010 (12)

    17 / 04 Post 1
    22 / 05 Post 2
    24 / 05 Post 3
    04 / 06 Post 4

    So, it would be great when I can adjust all the “Posts” in a row.

    Have you an idea?

    • Hi memo22,

      adding the following CSS to your theme’s style.css file should do the trick:

      .sya_container .sya_date {
          width: 50px;
          display: inline-block;

      Adjust the value of 50px depending on your theme.

  74. Hi Oliver,

    Love the plugin, but can’t seem to make it work with my theme (no formatting). Would you mind helping me out? I’d like the years to display in h3, not in p.


  75. Hi there

    Great plugin!

    How do I get to display my archive like your demo.

    The short codes are displaying the articles as well and I just want to show the year and article count like below

    2017 (67)
    2016 (19)
    2015 (12)

Leave a Comment

Data protection
, Owner: (Registered business address: Germany), processes personal data only to the extent strictly necessary for the operation of this website. All details in the privacy policy.
Data protection
, Owner: (Registered business address: Germany), processes personal data only to the extent strictly necessary for the operation of this website. All details in the privacy policy.