Developers · Gutenberg
QR Code block for WordPress
Generate a QR code from any URL or text with custom colors and size.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Generate a QR code from any URL or text with custom colors and size.
Inspector panels on this block: QR Code Content, Size & Layout, Caption & Download. Those titles come from index.js, not from a shared template.
Behavior controls: “URL or Text to Encode” (Paste any URL, phone number, email or plain text); “Error Correction” (Higher = more data redundancy, larger QR); “Size & Layout — Alignment” options: Left, Center, Right; “Border Style” options: Shadow, Border, None.
Where to find it
Gutenberg inserter → Developers → search “QR Code” (block name `blockenberg/qr-code` in block.json). Style it in the sidebar after insert.
How to use QR Code block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “QR Code”, insert it. Category: Developers.
- Configure inspector controls that exist on this block. Open QR Code Content. Set “URL or Text to Encode”, “Error Correction”, “QR Size (px)”, “Size & Layout — Alignment”.
- Check the published page. The view script reads HTML data attributes: data-content, data-level, data-size. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| URL or Text to Encode | Text field in the inspector. Paste any URL, phone number, email or plain text. block.json default: https://example.com. Saved as `content`. |
| Error Correction | Select control; the chosen value is saved on the block. Higher = more data redundancy, larger QR. Options: Low (L — 7%); Medium (M — 15%); Quartile (Q — 25%); High (H — 30%). block.json default: M. Saved as `errorLevel`. |
| QR Size (px) | Numeric range control in the inspector. Range 80–500. block.json default: 200. Saved as `size`. |
| Size & Layout — Alignment | Select control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `align`. |
| Card Padding (px) | Numeric range control in the inspector. Range 0–60. block.json default: 20. Saved as `cardPadding`. |
| Border Radius (px) | Numeric range control in the inspector. Range 0–32. block.json default: 12. Saved as `borderRadius`. |
| Border Style | Select control; the chosen value is saved on the block. Options: Shadow; Border; None. block.json default: shadow. Saved as `borderStyle`. |
| Show Caption | On/off toggle in the inspector. Off by default. Saved as `showCaption`. |
| Caption Text | Text field in the inspector. Saved as `caption`. |
| Show Download Button | On/off toggle in the inspector. On by default. Saved as `downloadable`. |
| Download Button Label | Text field in the inspector. block.json default: Download QR. Saved as `downloadLabel`. |
| Caption | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `captionTypo`. |
| QR Foreground | Color control in the inspector. block.json default: #1f2937. Saved as `fgColor`. |
| QR Background | Color control in the inspector. block.json default: #ffffff. Saved as `bgColor`. |
| Card Background | Color control in the inspector. block.json default: #ffffff. Saved as `cardBg`. |
| Border Color | Color control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`. |
| Caption Color | Color control in the inspector. block.json default: #6b7280. Saved as `captionColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-content, data-level, data-size.
When this is the right block
- Generate a QR code from any URL or text with custom colors and size — that is the job of QR Code, not a generic content block.
- Use it when you need the editor control labeled “URL or Text to Encode”, which exists on this block’s inspector.
- It matches pages about qrcode, barcode, link.
- Inserter grouping: docs sites, utilities, and developer landing pages.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the QR Code block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “QR Code”. It sits under Developers. After insert, open QR Code Content and set “URL or Text to Encode”, “Error Correction”, “QR Size (px)”, “Size & Layout — Alignment”.
What makes QR Code different from other Blockenberg blocks?
Generate a QR code from any URL or text with custom colors and size. Inspector labels on this block include “URL or Text to Encode”, “Error Correction”, “QR Size (px)”, “Size & Layout — Alignment”.
Is the QR Code Gutenberg block free?
Yes. QR Code ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style QR Code to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: QR Code Content, Size & Layout, Caption & Download).
Related developers blocks
Barcode Generator
Generate Code128 barcodes from any text or number. Customize bar height, width, colors, and download as PNG.
API Reference
Display API endpoint documentation with method badge, parameters table, and request/response code examples.
Base64 Encoder / Decoder
Encode plain text to Base64 or decode Base64 back to text. Supports Unicode, URL-safe Base64 and one-click copy.
Browser Mockup
Display a realistic browser chrome window around a customizable mini page preview — perfect for product screenshots, UI demos, and tutorials.
Clipboard Copy
Display a copyable code, coupon, or text with a one-click copy button.
Code Block
Syntax-highlighted code block with copy button, line numbers, and multiple themes.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert QR Code from the Gutenberg inserter.