Skip to content
Get it free

The free plugin

The [opensheetmusicdisplay] shortcode

For the classic editor, widgets and page builders. The shortcode draws the same score as the OSMD Sheet Music block, and every block setting has an attribute.

[opensheetmusicdisplay musicxmlurl="https://example.com/wp-content/uploads/2026/11/score.musicxml"]

Rules

  • musicxmlurl is required. Without it the shortcode shows nothing, not even an error. Take the URL from the Media Library: open the file and use Copy URL to clipboard.
  • Attribute names ignore case. musicXmlUrl and musicxmlurl are the same.
  • On and off: "true" turns an option on. Any other value, including "yes" and "1", turns it off.
  • Numbers can have decimals: zoom="0.75".
  • Leave an attribute out to get the value from OSMD Settings, or the plugin’s default where OSMD Settings has no field for it. Changing OSMD Settings changes every shortcode that leaves the attribute out.
  • Write each attribute as name="value" with a space after it. A comma or another character directly after the closing quote makes WordPress ignore the attribute.

Block settings

Attribute Default Block setting
musicxmlurl none Select Media
width 100 Width (%)
aspectratio 0 Container Aspect Ratio
zoom 1 Zoom (%)
drawtitle true Draw Title
drawsubtitle true Draw Subtitle
drawcomposer true Draw Composer
drawlyricist true Draw Lyricist
drawmetronomemarks true Draw Metronome Marks
drawpartnames true Draw Part Names
drawpartabbreviations true Draw Part Abbreviations
drawmeasurenumbers true Draw Measure Numbers
drawmeasurenumbersonlyatsystemstart false Draw Measure Numbers Only at System Start
drawtimesignatures true Draw Time Signatures
newsystemfromxml false New Systems From XML

Three of them take numbers that differ from the sidebar:

  • width is the percentage of the container: 75 for three quarters.
  • zoom is a factor, not a percentage: 1 = 100 %, 0.75 = 75 %, 2 = 200 %.
  • aspectratio: 0 shows the whole score without a scrollbar, 1.5 is Landscape, 0.5625 Portrait. Any other number sets the height to the width divided by it.

Example with drawing options:

[opensheetmusicdisplay musicxmlurl="https://example.com/wp-content/uploads/2026/11/song.mxl" zoom="0.8" width="75" drawcomposer="false" drawpartnames="false" drawmeasurenumbersonlyatsystemstart="true"]

Music Braille

All off by default. See Music Braille for what each one does.

Attribute Block setting
brailleenabled Show Music Braille
braillehidescore Hide Score (Braille Only)
braillelyrics Lyrics
braillebaroverbar Bar-over-bar (Keyboard)
brailleensemble Ensemble
braillefacsimile Facsimile (Mirror Print Layout)
brailleshowtranslation Show Translation (Sign Meanings)

More OSMD options

The shortcode passes these straight to OpenSheetMusicDisplay 3.0.0. The block sidebar doesn’t show them, so they’re shortcode only.

Attribute Default What it does
drawcredits true false hides title, subtitle, composer, lyricist and copyright at once
drawlyrics true Lyrics, with their extensions and dashes
drawfingerings true Fingerings
fingeringposition aboveorbelow above, below, aboveorbelow, left, right, or auto (experimental)
drawfrommeasurenumber first Start drawing at this measure
drawuptomeasurenumber last Stop drawing after this measure
drawuptosystemnumber all Draw only the first n systems
measurenumberinterval 2 Draw a measure number every n measures
usexmlmeasurenumbers true Take measure numbers from the file instead of counting from 1
tupletsratioed false Label tuplets as a ratio, e.g. 5:2 instead of 5
tupletsbracketed false Bracket all tuplets, not only those the file brackets
tripletsbracketed false Bracket all triplets; overrides tupletsbracketed for triplets
autobeam false Beam notes that the file leaves unbeamed
setwantedstemdirectionbyxml true false lets OSMD choose stem directions instead of the file
fillemptymeasureswithwholerest 0 1 fills empty measures with a whole rest, 2 with an invisible one
stretchlastsystemline false Stretch the last system across the full width like the others
spacingfactorsoftmax 15 Note spacing: lower is tighter, 100 is very wide
drawingparameters default Preset layouts: compact, compacttight (compact with smaller margins), leadsheet, preview, thumbnail, allon
pageformat Endless Pages instead of one endless sheet: A3_P, A3_L, A4_P, A4_L, A5_P, A5_L, A6_P, A6_L, Letter_P, Letter_L (P = portrait, L = landscape)
newpagefromxml false With a page format: start a new page where the file says so
drawuptopagenumber all With a page format: draw only the first n pages
pagebackgroundcolor transparent Background behind the notes, e.g. #ffffff on a dark theme
defaultcolornotehead black Notehead color, #rrggbb (or #rrggbbaa with opacity)
defaultcolorstem black Stem color
defaultcolorrest black Rest color
defaultcolorlabel black Color of text such as lyrics and the title
defaultcolortitle black Color of the title texts; overrides defaultcolorlabel for them
colorstemslikenoteheads false Give stems the color of their noteheads
coloringmode 0 0 = colors from the file, 1 = a color per note name (OSMD’s built-in set)
coloringenabled true false ignores note colors entirely
defaultfontfamily Times New Roman A font the visitor’s browser has, e.g. Helvetica. OSMD’s spacing is tuned for Times New Roman

An excerpt, measures 1 to 8, compact, on white:

[opensheetmusicdisplay musicxmlurl="https://example.com/wp-content/uploads/2026/11/sonata.mxl" drawfrommeasurenumber="1" drawuptomeasurenumber="8" drawingparameters="compact" pagebackgroundcolor="#ffffff"]

Premium attributes

With the premium add-on active, the shortcode also takes these.

Attribute Default Block setting
enableplayback true Enable Playback
followcursordummy true Follow Playback Cursor
transpose 0 Transpose by Semitone
usertranspose false User Transpose
userzoom false User Zoom
userpdf false User PDF Save
userpdfformat false User PDF Format Options
userxml false User MusicXML Save
drawcopyright false Draw Copyright Text
renderwithperformancemode false Performance Mode Rendering
persistuserruntimestate false Persist User Adjustments
scrollablepane false Scrollable Sheet Pane
paneheightmode legacy Pane Height: legacy (Default), preset, viewport or fixed
paneheightpreset standard Pane Height Preset: compact, standard or tall
paneheightviewportpercent 70 Browser Height Percentage, 20 to 100
paneheightfixedpx 520 Fixed Pane Height in pixels, 240 to 1400

Playback, cursor, transposition, copyright, performance mode and the visitor controls except MusicXML Save have site-wide defaults under OSMD Settings. The pane height settings only apply with scrollablepane="true".

[opensheetmusicdisplay musicxmlurl="https://example.com/wp-content/uploads/2026/11/score.musicxml" usertranspose="true" userzoom="true" userpdf="true" userxml="true" scrollablepane="true" paneheightmode="fixed" paneheightfixedpx="600"]

The [pb-deep-link] shortcode for PracticeBird QR codes is retired for now; see PracticeBird QR codes.

Updated 27 November 2026, checked against free 1.6.0 (OSMD 3.0.0), premium 1.5.0. Something wrong or missing? Write to support@opensheetmusicdisplay.org.