Skip to content

Base Pages & URL Routing

Quantum Competitions relies on three core WordPress pages to structure your competition catalog, customize single competition URLs, and display historical draw outcomes.

Navigate to Competitions > Settings > General to configure your base pages:

Competition Base Pages Settings


The Competition Base Page (qcw_page_id) serves as the central storefront and catalog archive for all active competitions, analogous to the standard WooCommerce /shop/ page.

  • Query Takeover: When visitors land on this page, Quantum Competitions automatically intercepts the main WordPress query ($wp_query), setting:
    • post_type = 'product'
    • is_archive = true
    • is_post_type_archive = true
    • competition_archive = true
  • Shop Separation: By default, WooCommerce mixes regular physical/digital products and competitions in the standard /shop/ catalog. In Competitions > Settings > General, enable Do not mix competition and regular products on shop page (qcw_dont_mix_shop) to isolate regular products on /shop/ and competitions exclusively on your Base Page (e.g., /competitions/).
  • Breadcrumbs & SEO: Breadcrumbs automatically use the Base Page title and permalink as the parent crumb for single competition products. Yoast SEO and RankMath meta descriptions assigned to the Base Page are automatically preserved.
  • Homepage Integration: You can assign the Base Page as your front page under WordPress Settings > Reading (show_on_front = page). The plugin detects COMPETITIONS_IS_ON_FRONT and handles root pagination without 404 errors.

The Competition Entry Page (qcw_entry_page_id) enables custom URL routing for single competition product pages, replacing the default WooCommerce /product/ permalink structure with a branded entry path.

When an Entry Page is selected (for example, a WordPress page with the slug enter or play), Quantum Competitions automatically registers custom rewrite rules:

^enter/([^/]*)/?$ -> index.php?pagename=enter&competition_entry=true&competition_single_entry=$matches[1]
^enter/([^/]*)/page/([0-9]{1,})/?$ -> index.php?pagename=enter&competition_entry=true&competition_single_entry=$matches[1]&paged=$matches[2]
  1. Branded Permalinks: Single competition links generated across the storefront (post_type_link) are filtered to route through the entry structure:
    • Default WooCommerce: https://yourstore.com/product/aston-martin-vantage/
    • With Entry Page: https://yourstore.com/enter/aston-martin-vantage/
  2. Future Competition Filtering: Prevents visitors from accessing upcoming or scheduled competitions until their official launch date/time is reached.
  3. Automatic Rule Flushing: Updating this page in plugin settings sets the internal flag qcw_flush_rewrite_rules, automatically regenerating WordPress permalinks without requiring manual .htaccess edits.

The Competition Draw Results Page (qcw_draw_results_page_id) is the public audit trail and winners archive for all closed or drawn competitions.

The plugin hooks into the template output filter (filter_draw_results_page_content):

  • When visitors view the configured Draw Results page, the plugin checks if the content already contains [competition_draw_results] or [competitions_draw_results].
  • If neither shortcode is found, it automatically appends do_shortcode( '[competition_draw_results]' ) to the page content.
  • Renders a searchable, paginated table displaying:
    • Competition Title & Thumbnail
    • Winning Ticket Number(s)
    • Winner Name / Masked Username
    • Official Draw Date & Time
    • Direct links to live draw recordings or random engine certificates

To set up base pages on a fresh installation:

  1. Go to Pages > Add New in WordPress and publish three empty pages:
    • Competitions (slug: competitions)
    • Enter (slug: enter or play)
    • Draw Results (slug: draw-results)
  2. Navigate to Competitions > Settings > General:
    • Set Competition Base Page to Competitions.
    • Set Competition Entry Page to Enter (or leave empty if you prefer /product/ permalinks).
    • Set Competition Draw Results Page to Draw Results.
  3. Click Save changes.