How to Add Unique QR Code to All WordPress Blog Posts Easily

Want to add a unique QR Code to all WordPress blog posts? QR codes are a great way to let mobile users use QR code readers to visit urls and get custom experiences in a click.

Add QR Code

Use Google Chart API to generate unique QR codes for each WordPress blog post. Simply add the following code in the your single.php file where you want the QR code to appear.

<img src="|4&chl=<?php the_permalink(); ?>" width="150" height="150" alt="QR code" />

QR Code Parameters

Here is the break up of the QR code parameters which you can change

–  calls the Google Chart API

cht=qr chooses to display the QR code option

&chs=100x100 calls for the 100 px square size

&chld=L|4 – call for default error correction level and margin (in rows). So want more white border around the code, increase the 4

&chl=<?php the_permalink(); ?> call for the permalink of the single post. Use the url you want.

This will add QR codes of size 100px x 100px to your site. You can change the 100 to 200 or whatever pixel size you like as per your blog template. But remember that very small QR codes are difficult to read by many QR code readers.

So for the main page, I can use this×200&chld=L|1&chl=

QR code for QOT

Scan it with your QR code scanner and see if it works.


  1. Shaun Hare says:

    Create post, yes I think this is a must actually I created a plugin to do that many moons ago it is in a google code project,
    Just forgot to tell people about it

  2. Sagar Gholap says:

    Thanks for the tip. Will try it out and see if it works for me.

  3. Namit Gupta says:

    Nice Tip! This code can be brought to several uses. Thanks for sharing.

  4. Tech Crates says:

    Nice…Gonna try this

  5. Swamykant says:

    Nice tip. Will give a try soon :)

  6. Kader says:

    Very nice topic thank you.

  7. Martin says:

    Hi, thank you for that nice article to use google Chart API for QR Codes. Sometimes one is not interestend in using Google for tooo many thing in life. We set up an own WordPress plugin which does not work with Googles’ API. If it’s interesting for someone take a look at:

Leave a Reply

Your email address will not be published. Required fields are marked *