Search posts by date

Is there an easy way to search through the 1200 or so posts on my site and find everything that was published in, say, August 2014?

This was trivial in WordPress and in the past it worked well if you tried a date restricted Google search. Google no longer handles this well, so I’m looking for a way to do it from within my Ghost site.

There is no way to do it directly in dashboard but there is a workaround.

Go to dashboard->settings-analytics

In here, export the posts analytics.

It will generate a CSV of your posts with publish date among other stats. Open it in Google Sheets or other office suite and use the filter option as per your need.

1 Like

This is a fabulous resource, for a minute I thought this would be what I wanted, but it only loads the last 1000 posts… which takes me back to 2014.

The reason I wanted to sort old posts by date was so I could do a “on this site ten years ago today” post. Your brilliant solution misses by about six months.

Do you know if there a way to download more than 1000 posts?

My website has nearly 2,000 articles and all of them were exported. Not sure why yours were restricted to 1000 only.

If your aim is to display article that was published ‘ten years ago’, I found something which you may tweak in your theme:

The code here gets all the post published in the 11th month (November):

{{#get "posts" filter="month:11"}}
  {{#foreach posts}}
    <h2>{{title}}</h2>
    <p>{{excerpt}}</p>
  {{/foreach}}
{{else}}
  <p>No posts found for November.</p>
{{/get}}

I believe something similar can be done to get posts from specific month, year or date.

I let you explore that in Ghost documentation :slight_smile:

Thanks again Abhishek. Like I said, your original solution is brilliant.

I wonder if the 1000 limit is because I’m on Ghost Pro and that it would be different for self-hosted sites?

I’ll give the other idea a try.

Happy to be of help, Bill :slight_smile:

1 Like