Migrating from Wordpress and Yoast Seo to Hexo
Recently I migrated from Wordpress to static blog generator Hexo.io. I also modified default hexo-wordpress-migrator a little bit in order to support Yoast seo meta keywords and description,
[code] blocks and more tag.
But Wordpress is great, why did I switch from it?
While Wordpress has a lot of great features and modules, I was not using them. I felt that Wordpress had just too much functions and code for such a simple blog as mine. And what could be simpler than Markdown and static files?
Also wysiwyg online interface didn’t work well for me. I usually post some code examples and have to manually prepare them in some other editor before posting into Wordpress. I do proper formatting as it’s impossible to do TAB or Shift+TAB and other things in browser.
It would be great to use just one editor to do it all, that is VS Code, which btw is great!:)
All in all Wordpress seemed like an overkill.
Hexo.io is a static blog generator which supports Markdown. It seems pretty mature, stable and has a lot of modules and themes. That means I have to spend less time setting up blog and more time writing.
Installation is pretty simple, install it from npm, init new blog and create some markdown files. There are several automatic deploy options provided or you can just copy all your files to remote server.
Hexo provides migration options as well. In order to migrate from Wordpress there is hexo-migrator-wordpress plugin (https://hexo.io/docs/migration.html#WordPress)
My WP blog was using Yoast seo plugin and it was not supported by default migrator plugin. So I had to add it manually. Then I added
<!--more--> wordpress tag support as my theme allowed it. Also I converted
[code] tags to markdown code and removed
If you need it, here is what to do. Feel free to modify as needed.
In your blog directory open
Find lines with fiels definitions and modify as follows
That’s it, your new blog posts will get nice tags and description and native markdown code formatting. You probably will still have to fix some things manually, but it’s a good place to start.