22

I am using to write my blog, I meet a trouble that I can not delete a post in blog. I just find create a post in command, but I could not find the delete or drop command. How can I delete a post in properly? What command should I use?

In addition, I push the blog to page. When I delete a post, can the page be changed?

hyyy
  • 221
  • 2
  • 3

3 Answers3

32

There is no command to delete a post on Hexo, but follow this steps :
1. Delete the post under source/_post folder
2. Run hexo clean to delete the database (db.json) and assets folder
3. Run hexo generateto generate the new blog without your deleted post
4. Run hexo deploy to deploy your blog

Alternatively you can use the hexo-admin plugin.

John Biesnecker
  • 3,782
  • 2
  • 34
  • 43
Louis Barranqueiro
  • 10,058
  • 6
  • 42
  • 52
  • 1
    make sure to scan the `public` folder for anything that should not be there before running `clean`. Someone may have stored assets there which will be deleted by `clean` – microsaurus_dex Sep 17 '19 at 01:39
2

You can just go to your hexo path/source/_posts, delete the one you wanna delete.

Then run

hexo generate

hexo deploy

you will see that one has gone from your blog site.

ronan
  • 1,611
  • 13
  • 20
1

You can delete the files under source/_post folder.

For question 2. It depends on which repo you are using.

MartinDlut
  • 11
  • 2