Tutorial: How To Add a Blog In Magento 2
Magento 2 is an eCommerce platform loaded with many awesome features. To run a Magento store with amazing speed and performance, a managed cloud hosting, like Cloudways, is required.
The word Blog was derived from ‘web log’. A blog is basically a type of website with posts appearing in reverse chronological order. If you have a running blog, you’d have noticed that it is easier to update posts on a blog and it’s also great for marketing your product or services. One of the most useful uses of a blog is that it helps you generate traffic for your website. It also makes it more SEO friendly and builds a better sales strategy. All in all, a blog will make the tie between you and your customers much stronger.
By default, Magento 2 does not provide the blog functionality. However, you can easily integrate a blog in Magento 2. All you need is a Blog extension and you can find many according to your need.
In this tutorial, we are going to learn how to integrate a Blog in Magento 2. I’ll use Magefan Blog for this review, and you can download it from here.
After downloading the file, extract it to a temporary directory.
In the root directory of your Magento, create folders app/code/Magefan/Blog. Your root directory will now look like this:
Now in the Blog folder, copy all the files and folders from the archive(Magefan Blog). You can use FileZilla for this action. The structure will now look like this:
Go to the Admin Panel of the Magento Store and navigate to the System tab from the left corner of the page. Next, click the Cache Management option.
Now flush the cache by clicking Flush Magento Cache.
Now disable the cache.
Launch the SSH terminal and then run these commands in the root directory of Magento:
php bin/magento setup:upgrade
php bin/magento setup:db-schema:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
Navigate to the Stores tab from the left corner of the page and click the Configuration option.
Now go to ADVANCED -> Advanced
You can now see the Magefan_Blog module here.
On the left side, you can see the Magefan Blog extension as shown below:
Navigate to the Content tab from the left corner of the page. Next, click the Posts option.
One post is already added by default: Hello World. You can add more posts by clicking Add New Post.
Launch your application and click on Blog.
This is your Blog page:
Blog is a crucial part of a store and it is helpful in many aspects. It is a marketing strategy that brings traffic to the store. After this tutorial, you should now be able to integrate a Blog to Magento 2. If you have any questions or would like to add to the discussion, please leave a comment below.
Syed Muneeb Ul Hasan is a Magento Community Manager at Cloudways. An expert in PHP and Magento, he prefers to educate users in implementing and using cloud-based Magento Hosting Solutions. When not working, he loves to watch cricket. You can email him at [email protected]