{"id":17725,"date":"2011-03-06T14:21:52","date_gmt":"2011-03-06T08:51:52","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=17725"},"modified":"2026-10-12T11:27:25","modified_gmt":"2026-10-12T05:57:25","slug":"add-qr-code-to-wordpress-blog-posts","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/","title":{"rendered":"How to Add a QR Code to WordPress Posts (Plugin and Code, 2026)"},"content":{"rendered":"<p>Want to add a unique <strong>QR code to WordPress<\/strong> posts so phone users can open or share the page in one scan? In 2011 we showed how to do this with one line of code using the Google Chart API. Google has since shut that API down, so the old code shows a broken image. Here are working ways to add a QR code to every WordPress post in 2026, with or without a plugin.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-29965\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/qot200-qrcode.png\" alt=\"QR code for QuickOnlineTips\" width=\"200\" height=\"200\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/qot200-qrcode.png 200w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/qot200-qrcode-150x150.png 150w\" sizes=\"(max-width: 200px) 100vw, 200px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> The easiest way is a plugin such as Kaya QR Code Generator: add the shortcode <code>[kaya_qrcode]<\/code> to a post, widget or template and it shows a QR code for the current page URL. Without a plugin, add an image tag in your theme that calls a QR image API with the post permalink, or generate the code in the browser with a small JavaScript library.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_88 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6accbef76cf32\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6accbef76cf32\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#Why_add_QR_codes_to_posts\" >Why add QR codes to posts?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#Method_1_Use_a_QR_code_plugin_easiest\" >Method 1: Use a QR code plugin (easiest)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#Method_2_Add_a_QR_image_to_your_theme_no_plugin\" >Method 2: Add a QR image to your theme (no plugin)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#Method_3_Generate_QR_codes_in_the_browser\" >Method 3: Generate QR codes in the browser<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#QR_code_tips\" >QR code tips<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#Does_the_Google_Chart_API_still_make_QR_codes\" >Does the Google Chart API still make QR codes?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#Do_QR_codes_expire\" >Do QR codes expire?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2011\/03\/add-qr-code-to-wordpress-blog-posts\/#Can_I_add_a_QR_code_without_a_plugin\" >Can I add a QR code without a plugin?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_add_QR_codes_to_posts\"><\/span>Why add QR codes to posts?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Readers on a desktop can scan to continue reading on their phone.<\/li>\n<li>Printed pages, slides and posters can carry a scannable link.<\/li>\n<li>Event pages, menus, product pages and downloads become easy to open on mobile.<\/li>\n<\/ul>\n<p>Tip: Chrome and Edge already have a built-in <em>Create QR code<\/em> option in the share or address-bar menu, so many visitors can make their own. Adding one to your page simply makes it obvious.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Method_1_Use_a_QR_code_plugin_easiest\"><\/span>Method 1: Use a QR code plugin (easiest)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li>Go to <strong>Plugins &gt; Add New<\/strong> and install <a href=\"https:\/\/wordpress.org\/plugins\/kaya-qr-code-generator\/\" target=\"_blank\" rel=\"noopener\">Kaya QR Code Generator<\/a> or a similar plugin.<\/li>\n<li>Add the shortcode <code>[kaya_qrcode]<\/code> where you want the code. With no content, it uses the current page URL automatically.<\/li>\n<li>To show it on every post, add the shortcode to a widget area, or to your single post template in the Site Editor using a Shortcode block.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Method_2_Add_a_QR_image_to_your_theme_no_plugin\"><\/span>Method 2: Add a QR image to your theme (no plugin)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This replaces our old Google Chart code. Add it to your classic theme&#8217;s <code>single.php<\/code> (in a child theme) where you want the QR code:<\/p>\n<pre><code>&lt;img src=\"https:\/\/api.qrserver.com\/v1\/create-qr-code\/?size=150x150&amp;data=&lt;?php echo urlencode( get_permalink() ); ?&gt;\" width=\"150\" height=\"150\" alt=\"QR code for this post\" loading=\"lazy\" \/&gt;<\/code><\/pre>\n<ul>\n<li><strong>size<\/strong> sets the image size, for example 150&#215;150 or 200&#215;200. Very small codes are hard to scan.<\/li>\n<li><strong>data<\/strong> is the URL to encode; <code>urlencode()<\/code> keeps special characters safe.<\/li>\n<li>This uses a third-party service from <a href=\"https:\/\/goqr.me\/api\/\" target=\"_blank\" rel=\"noopener\">goQR.me<\/a>, so check its terms and remember the service sees which URLs are requested.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Method_3_Generate_QR_codes_in_the_browser\"><\/span>Method 3: Generate QR codes in the browser<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>For full privacy and no external requests, load a small open-source library such as <a href=\"https:\/\/github.com\/davidshimjs\/qrcodejs\" target=\"_blank\" rel=\"noopener\">QRCode.js<\/a> and create the code from the page URL with a few lines of JavaScript. It works on any theme, including block themes, via a Custom HTML block.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"QR_code_tips\"><\/span>QR code tips<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Keep a white margin (quiet zone) around the code.<\/li>\n<li>Use dark code on a light background for reliable scanning.<\/li>\n<li>Use short URLs when possible; shorter data means a simpler code. See how to make <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2010\/05\/create-short-urls-for-your-domain-name-to-retweet-easily\/\">branded short URLs<\/a>.<\/li>\n<li>Test with both an iPhone and an Android camera before printing.<\/li>\n<\/ul>\n<p>QR codes are also handy for <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/06\/offline-blog-promotion-tips\/\">offline blog promotion<\/a> on business cards and flyers.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Does_the_Google_Chart_API_still_make_QR_codes\"><\/span>Does the Google Chart API still make QR codes?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. Google deprecated its image charts, including QR codes, and turned them off, so old <code>chart.apis.google.com<\/code> code no longer works.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Do_QR_codes_expire\"><\/span>Do QR codes expire?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A static QR code that encodes your URL directly never expires. Dynamic QR codes from paid services stop working if the subscription ends.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_add_a_QR_code_without_a_plugin\"><\/span>Can I add a QR code without a plugin?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. Use the theme code above or a JavaScript library in a Custom HTML block.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to add a unique QR code to WordPress posts so phone users can open or share the page in&#8230;<\/p>\n","protected":false},"author":4,"featured_media":29965,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-17725","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/17725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=17725"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/17725\/revisions"}],"predecessor-version":[{"id":64282,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/17725\/revisions\/64282"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/29965"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=17725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=17725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=17725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}