Universally Documentation

Step-by-step guides, multilingual SEO tips, and best practices to help you translate and scale your WordPress website.

Exclude Link Localization

Link localization applies to:

  • All <a href> links pointing to pages on the same domain
  • Canonical URLs (<link rel="canonical">)
  • Open Graph URLs (og:urlog:imageog:video, etc.)
  • Twitter Card URLs (twitter:imagetwitter:player, etc.)

Use Exclude Link Localization to prevent specific links from being rewritten. This setting is in your project’s Settings tab. Enter one URL pattern per line.

When to Use

Some links should never have a language prefix added:

  • File downloads — /downloads/report.pdf should not become /fr/downloads/report.pdf
  • API endpoints — /api/v1/data must stay as-is
  • Admin pages — /wp-admin/ links should not be localized
  • Static assets — /wp-content/uploads/image.jpg should not be prefixed
  • External service callbacks — payment or auth return URLs
  • RSS feeds — /feed/ endpoints

Pattern Syntax

Patterns are matched as URL fragments. If the URL contains the pattern anywhere in its path, the link is excluded from localization.

/wp-content/
/wp-admin/
/api/
/downloads/
/feed/

For example, the pattern /wp-content/ matches any URL containing that string:

  • /wp-content/uploads/photo.jpg — excluded
  • /wp-content/themes/style.css — excluded
  • /about-wp-content/ — also excluded (substring match)

Examples

WordPress sites

/wp-content/
/wp-admin/
/wp-includes/
/wp-login.php
/wp-signup.php
/wp-activate.php
/xmlrpc.php
/wp-cron.php
/wp-json/
/feed/
/comments/feed/

Note: These are configured automatically for WordPress sites. You only need to add custom patterns.

E-commerce

/cart/add
/checkout/
/webhook/
/downloads/

General

/api/
/assets/
/static/
/uploads/
/_next/

How It Works Internally

When Universally processes a translated page, it rewrites URLs in two ways depending on your URL structure:

Subdirectory mode (default)

Links are prefixed with the language code:

  • /about → /fr/about
  • /blog/post → /fr/blog/post

Subdomain mode

The domain is changed to the language subdomain:

  • https://example.com/about → https://fr.example.com/about

Excluded patterns bypass this rewriting entirely — the original URL is preserved as-is.

Things to Note

  • Patterns are substring matches, not exact matches or wildcards
  • External links (different domain) are never localized regardless of this setting
  • Links inside elements excluded by CSS selectors are also not localized
  • Anchor-only links (#section) are never localized
  • The hreflang attribute on links prevents localization by default (no configuration needed)
Was this helpful?