# Exclude links from ajax navigation

> Make chosen pages load the normal way, with plain patterns, wildcards or regular expressions.

Source: https://arraystory.com/docs/ajaxpress/exclude-links/

**Exclude Links** sends chosen links through a normal, full page load instead of ajax navigation. Use it for a page that only works on a fresh load, such as one whose plugin sets things up once per page load, or a members area that needs a real reload after sign-in.

You'll find it under **Settings → AjaxPress → Advanced → Exclude Links**. It's free.

> [!WARNING]
> A normal page load restarts everything on the screen, including a [persistent player](https://arraystory.com/docs/ajaxpress/keep-audio-or-video-playing-across-pages/). Avoid excluding pages your listeners visit while a player is running.

## Add a pattern

Enter one pattern per line, then **Save Settings**. Any link whose address matches a pattern loads the normal way.

![Add a pattern under Advanced → Exclude Links, and matching pages load the normal way.](https://r2.arraystory.com/docs/ajaxpress/exclude-links.mp4?v=a590121771)

```text
checkout
members/
/^\/(shop|product)\//
```

Patterns are matched against the part of the address after the domain: the path, plus the query string if there is one. So for `https://example.com/shop/shoes/?color=red`, AjaxPress checks `/shop/shoes/?color=red`.

> [!NOTE]
> Leave out the domain. A pattern like `https://example.com/shop` never matches, because the domain isn't part of what's checked. Write `/shop` instead.

## Plain patterns

A plain pattern matches when it appears **anywhere** in the path and query. Plain patterns aren't case-sensitive.

| Pattern | Matches | Also matches |
| --- | --- | --- |
| `/checkout` | `/checkout/`, `/checkout/order-received/123/` | `/checkout-help/` |
| `members/` | `/members/`, `/members/profile/`, `/club/members/` | |
| `download=` | `/files/?download=42` | |

Keep plain patterns specific. A short one like `shop` also matches `/workshop/` and `/blog/shopping-tips/`.

## Wildcards

| Symbol | Matches |
| --- | --- |
| `*` | Any characters except `/`, so it stays within one part of the path |
| `**` | Any characters, including `/` |
| `?` | Exactly one character |

For example, `members/*/edit` matches `/members/anna/edit/` but not `/members/anna/photos/edit/`, and `members/**/edit` matches both.

## Regular expressions

A pattern written between slashes is a regular expression, with optional flags after the last slash:

| Pattern | Matches |
| --- | --- |
| `/^\/shop\//` | Paths that start with `/shop/` |
| `/^\/(cart\|checkout)\//` | Paths that start with `/cart/` or `/checkout/` |
| `/\.pdf$/i` | Addresses ending in `.pdf`, in any case |

Unlike plain patterns, regular expressions are case-sensitive unless you add the `i` flag.

> [!WARNING]
> **Any pattern that starts with `/` and contains another `/` is read as a regular expression.** So `/shop/*` or `/members/*` doesn't work as a wildcard: it's read as a broken regular expression and never matches. Write `shop/*`, `shop/` or `/^\/shop\//` instead. The example in the setting's help tooltip uses this broken form; the forms on this page are the ones that work.

## Check a pattern

Open a page on your site, open the browser console (<kbd>F12</kbd>, then **Console**), and run:

```js
AjaxPress.shouldBypass('https://example.com/shop/shoes/')
```

`true` means that link loads the normal way; `false` means AjaxPress handles it. Save your settings and reload the page before you test a new pattern.

## Good to know

- **Only the trip to the page is a normal load.** AjaxPress still runs on the excluded page itself, so links on it navigate over ajax again.
- **Forms follow the same rules.** A form that submits to an excluded address submits the normal way.
- **Some links are always excluded**, with no pattern needed: other sites, wp-admin, uploaded files, downloads, new-tab links and more. See [Which links AjaxPress handles](https://arraystory.com/docs/ajaxpress/which-links-ajaxpress-handles/).
- **Developers** can add patterns in code with the `bypassPatterns` filter. See the [JavaScript extension API](https://arraystory.com/docs/ajaxpress/javascript-extension-api/#bypasspatterns).
