1. Home
  2. Docs
  3. Divi Extended Loop
  4. Dynamic Content
  5. URL Query Parameter

URL Query Parameter

The URL Query Parameter dynamic content option reads a value from the current page's query string ($_GET) and renders it safely inside a module. Use it to personalize content based on the URL — for example, show a location name from ?city=Miami, a referral code from ?ref=partner, or a full link from ?mainUrl=https://example.com/page.

It is available under the Extended Loop group in the dynamic content picker and works in text, URL, image, and number fields.

Getting Started

  1. Add any module that supports dynamic content (a Heading, Button, or Image module, for example).
  2. Open the field's dynamic content options and choose Extended Loop → URL Query Parameter.
  3. Enter the Parameter Name you want to read from the URL.

When the page renders, the value from the visitor's URL is inserted. If the parameter is not present in the URL, the field is left empty.

Settings

1. Parameter Name

The URL query parameter to read. Enter only the parameter name, without the leading ?.

  • For ?city=Miami, enter city.
  • For ?ref=partner, enter ref.
  • For ?mainUrl=https://example.com/page, enter mainUrl.

Notes

  • The value is sanitized with WordPress's sanitize_text_field(), so HTML and scripts are stripped before output — safe for headings and text.
  • URL values are preserved, making it suitable for button links and image URLs; the module's own esc_url() provides the final URL-protocol hardening.
  • If the parameter is passed as an array (for example, ?city[]=a&city[]=b), it is ignored and the field is left empty.
  • This option is not loop-dependent: it always reads from the current page's query string, regardless of the loop or page.

How can we help?