2012-03-12 #wordpress

Create QR Codes For Your Wordpress Posts

QR can be used by mobile devices to scan and get bits of data, they can even be used to display a web page. They are starting to become more and more popular the more mobile devices are being used. But creating your own QR codes can be difficult and if you want one for each post of your blog it can be very time consuming. There is a company called QR-Server which provide an API to create QR codes, all you have to do is query this API with the width and height of the QR code you want, the website you want it to redirect to and it will generate a QR code for you.

Paulund QR Code

Wordpress Shortcode

Using this API we can create a QR code for any page, now we are going a Wordpress shortcode to generate the QR of the current page. Just copy and paste the following into your functions.php page to create the shortcode.

function currentpage_qr_code( $atts ) {
        'size' => '300'
    ), $atts)); 

    global $post;  

    return '<img src="'.$size.'x'.$size.'&amp;data='.get_permalink( $post->ID ).'" alt="'.$post->post_title.'"/>';  

add_shortcode('currentqr', 'currentpage_qr_code');

Add the shortcode anywhere in your posts to generate a QR code for the current page.


Create QR Codes For Your Wordpress Posts

All you have to do is scan this QR with your mobile and you will be able to see this page on your phone.


Reliable uptime monitoring and instant alerts for any website downtime.

  • Uptime Monitoring
  • Performance Monitoring
  • SSL Certificate Alerts
  • Domain Monitoring
  • DNS Checker
  • XML Sitemap Monitoring