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.

Share with friends

About the Author: P Chandra is editor of QOT, one of India's earliest tech bloggers since 2004. A tech enthusiast with expertise in coding, WordPress, web tools, SEO and DIY hacks.