URL Structure

When using filters in a Better Loop block, the page URL will automatically update to show the filters in use. This means that your visitors can easily share specific filters with others, and reload the page without worrying about losing their filters.

You can try it out in the demo below—search for chicken, choose the American cuisine and watch how the URL changes.

Cuisine
  • Apple & Blackberry Crumble

  • Apple Frangipan Tart

  • Baked salmon with fennel & tomatoes

The base URL for this page is:
https://betterloopwp.com/docs/url-structure/

When adding filters, a “query variable” will be added to the base URL, prepended by a question mark ?. When you add multiple filters, they will be combined with an ampersand &.

For example, searching for chicken recipes with the American cuisine will add this to the base URL:
?_0_search=chicken&_0_recipe_cuisine=american

Every query variable is prepended with _0_. The first underscore is added by Better Loop to prevent potential clashes with the query variables that WordPress itself uses.

The second part, 0_, contains the loop ID. If you have multiple loops on a page, each loop will have a unique ID, which means that you can safely filter multiple loops at the same time and still have the URLs work without any issues.