Search code examples
ghost-blog

How to change the slug in Ghost to include only year and month?


In the latest release you have allowed us to add the date in the post slug. Is it possible to add only the year and the month? Even by editing the code? Because I'm trying to migrate from Wordpress I need it. In WP I use that format.

Note : I'm using Ghost 0.5


Solution

  • This is currently only possible to do in the database. You can change the value of the key permalinks in the settings table to read /:year/:month/:slug or run the following query on the database:

    UPDATE settings SET value = '/:year/:month/:slug` WHERE key = 'permalinks'

    In case you're using the default database (SQLite3) you can use a tool like SQLite Browser