Magento 2 tutorials

How to setup a free blog for Magento 2 website

Pinterest LinkedIn Tumblr

Have you ever questioned how to get more organic or social traffic to your eCommerce website? An Magento 2 eCommerce website normally contains only product post, category post. There’s no added value to attract customers to visit your website.

This is why you should consider using a blog to gain more organic traffic to your store.

Blog (also known as weblog) is a form of website, exists in the form of online diary, bloggers can be an individual or a group to write everything they want. But mainly, each blog usually talks about 1 or 1 specific fields and they present from their personal point of view based on their knowledge and understanding, the process of experience.

setup blog for magento 2 website

There are many ways to monetize organic or social traffic from blog. You can install tracking code for remarketing campaign or you can insert product suggestion into blog post.

There are tons of benefits using a blog for eCommerce. Unfortunately, Magento does not have a built-in blog. So, in this article, I will guide you 2 methods on how to setup a blog for Magento 2:

  • Method 1: Setup a blog using a Magento 2 extension.
  • Method 2: Use WordPress blog independently.

You can choose the method that works best for you.

Setup a blog using free Magento 2 blog extension

As per my experience with Magento, this is the best method because you don’t need to use any other CMS (content management system) like WordPress. You can manage blog posts directly in Magento 2 backend.

Using this method, what we need to do is install a blog extension for Magento 2, enable it in backend, customizing the blog and start posting. The process of installing blog extension is the same with installing a new Magento 2 extesnion

Step 1: Get a Free Blog extension for Magento 2.

There are many blog extensions for Magento 2, both paid and free. I have tried various extensions and I can conclude that you don’t need to use paid extension, the free ones are totally enough to create an eye-catching and fully functioned blog for Magento 2.

Before we start, I would like to mention some remarkable blog extensions for Magento for your choice:

In this tutorial, I’m going to use Mageplaza blog extension to set up a blog for Magento 2 store.

There are 3 ways to install Mageplaza blog extension for Magento 2

  1. Via Composer
  2. Via Magento 2 marketplace
  3. Manually install

1 – Install Blog extension using composer (the quickest way)

In this tutorial, we will install Mageplaza blog extension using Composer

First, connect to your server using SSH and install composer and make composer available for global use (so we don’t need to change directory to composer directory every time we want to run composer command) by using this command

curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer

Next, we will install Mageplaza better blog extension

composer require mageplaza/magento-2-blog-extension mageplaza/module-blog-graphql
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

In this command, the  GraphQL module is installed to enable Progressive Web App (PWA) for your blog

2. Install blog extension via Magento 2 market place

By using this method, you don’t need access to SSH or CLI.

Here’s the link of better blog extension on Magento 2 market place (it’s free): https://marketplace.magento.com/mageplaza-magento-2-blog-extension.html

better blog extension add too cart

Register for an account on Magento 2 marketplace, log in and click on add to cart.

Next, go to checkout page and finish the order

finish order

After you are done, you will be redirect to success page

successful order

Now you will have 2 options to install better blog extension:

  • If you click on Install > you will be redirected to Magento 2 access key page. With this option, you can install extension using Web Setup wizard of Magento 2
  • If you click on Download > You will download extension package as .zip file. With this option you will need to install the extension manually by uploading extension folders to Magento 2 root folder.

Now, we will install using access keys. In magento 2 backend go to System > Web setup wizard, input your access key and private key here. These keys can be found in profile section in Magento Marketplace website: https://marketplace.magento.com/customer/accessKeys/

pair of keys

After you enter these key, Magento 2 will synchronize your order details on Marketplace and start install Magento 2 better blog extension.

input access key and private key

3. Install better blog manually

If you choose to get theme package as .zip file, you will need to install the extension manually. Follow these steps

You can also get better blog directly on Mageplaza website and go to my license section to download extension package

download better blog on mageplaza page

After downloading extension package, unzip the extension and you will see app folder, just upload this to your Magento 2 root folder. You can also copy blog_v4.0.0_m2_ce_mageplaza\app\code\Mageplaza folder to magento2root\app\code\ folder to install the extension

Finally, update database to enable extension in Magento 2 backend with these commands:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

Step 2: Configure blog extension to create a blog on Magento 2 website

After successfully installed Better blog extension, go to admin > Mageplaza > Better blog

magento 2 blog extension

First, go to Author section to create an author

add author

Next add categories and sub categories for your blog in Categories section

add category

You can also define store views and set category URL key, Meta title, description as well (for SEO purpose)

category seo

Finally, add post to the blog.

add post

You can choose category/topic/tag and allow/not allow comment for post as well

post option

Now your post is ready, click on Save post to publish your first blog post.

Now we will finish some final steps to display blog on Magento 2 website.

In Magento 2 backend go to Store > Configuration > Better Blog

better blog option

In this section, you can enable/ disable blog, set blog name, set routname and URL surffix.

blog options

If you want to set link to blog as: youwebsite.com/blog.html and display blog in Top Navigation then enter

  • Route name: blog
  • Url Surffix: .html
  • Show blog link in top menu: yes

Click on save config to publish your blog

Now go to your website with the URL: yourwebsite.com/blog.html to see your Magento 2 blog page

magento 2 blog page

You can also change post display style

post display style

There’s also import option if you want to migrate the existing blog database to better blog. You can import data from WordPress or other Magento 2 blog extension providers like Magefan, Aheadworks. All you need to do is enter database information of the blog you want to import.

import data from other blog platform

There are many other options included in Better Blog extension, you will explore more when start using this extension.

Use WordPress blog independently

WordPress, as you may know, is the most popular blogging platform at the moment. WordPress is well-known for its flexible, light-weight and easy-to-use.

I bet many of you are familiar with this WordPress and want to keep using WordPress as blog platform on Magento 2 website.

Now I will guide you how to setup and integrate WordPress blog to Magento 2.

Step 1: Setup WordPress blog

We will install a completely new WordPress blog first. Go to https://wordpress.org/download/ to download the latest version of WordPress.

get wordpres

Next, create a folder to store WordPress blog code on your Magento 2 website, for example: /blog/

create blog folder

Upload WordPress code to blog folder and exact the archived file.

Now let’s create a separate database for this WordPress blog (you can also use Magento 2 website database as database storage for WordPress blog but I do not recommend this method. It’s better to have 2 separate databases for better management)

*Using phpmyadmin: click on New  and enter database name then click on create

create wordpress blog database phpmyadmin

*Using CLI command: SSh to your server and use the following command

Login to mysql

mysql - u root - p

You will be prompted for password, enter root password. Next create a new database, eg: wordpressblog

mysql> create database wordpressblog;
Query OK, 1 row affected (0.01 sec)

Step 2: Configure wordpress blog database

On browser, enter youmagento2website.com/blog/ > you will be redirected to wordpress installation page

wordpress instalaltion page

In this step, enter the database information we created in STEP 1

  • Database name: wordpressblog
  • Username: root
  • Password: ******

Finally, click on Submit to proceed to the next step.

finish install wordpress

Now enter your desired login credentials:

  • Site title: your blog title, eg: My Magento 2 blog
  • Username: admin username
  • Password: admin password
  • Email: admin email

If you don’t want search engine to index your blog select discourage search engines from indexing this site.

Finally, go to admin section > Setting > General on WordPress blog and change blog url to yourwebsite.com/blog

general setting wordpress

Click on save change. Now you will be able to access your Magento 2 blog from: yourwebsite.com/blog/

Now you just need to add link to blog to top menu or main navigation menu, or footer section so that customer can access your blog from homepage.

Conclusion

There’s another hybrid method: integrate WordPress blog to Magento 2, you blog will keep Magento 2 website layout, header, footer… I will write a tutorial about this method in another blog post, keep following my blog to get new Magento 2 tutorial everyday.

I hope the tutorial will be helpful for you to create your own blog on Magento 2. If you have any troubles during blog installation process, just drop a comment below.

Good luck!

Hung Tran is the main editor of magentip.com, he loves to write about everything related to Magento 2

1 Comment

Write A Comment