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.

Get Blockenberg

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

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “QR Code”, insert it. Category: Developers.
  3. 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”.
  4. 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

ControlWhat the code does
URL or Text to EncodeText field in the inspector. Paste any URL, phone number, email or plain text. block.json default: https://example.com. Saved as `content`.
Error CorrectionSelect 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 — AlignmentSelect 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 StyleSelect control; the chosen value is saved on the block. Options: Shadow; Border; None. block.json default: shadow. Saved as `borderStyle`.
Show CaptionOn/off toggle in the inspector. Off by default. Saved as `showCaption`.
Caption TextText field in the inspector. Saved as `caption`.
Show Download ButtonOn/off toggle in the inspector. On by default. Saved as `downloadable`.
Download Button LabelText field in the inspector. block.json default: Download QR. Saved as `downloadLabel`.
CaptionShared Blockenberg typography popover (family, size, weight, spacing). Saved as `captionTypo`.
QR ForegroundColor control in the inspector. block.json default: #1f2937. Saved as `fgColor`.
QR BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Card BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `cardBg`.
Border ColorColor control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`.
Caption ColorColor control in the inspector. block.json default: #6b7280. Saved as `captionColor`.

What the front-end script actually does

When this is the right block

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

Get Blockenberg

Install Blockenberg from WordPress.org, then insert QR Code from the Gutenberg inserter.

Get Blockenberg