# How to fix the $.browser undefined error in WordPress

URL: https://wp24x7.com/how-to-fix-browser-undefined-error-in-wordpress/
Updated: 2026-11-29
Type: blog post
Audience: WordPress site owners and developers seeing jQuery errors

> A console error such as jQuery.browser is undefined means a script on your site uses a feature jQuery removed in version 1.9. WordPress now ships jQuery 3.x and no longer loads the migrate helper by default, so old code fails and takes that script down. The real fix is to update or replace the code responsible, with the migrate helper only as a short-term bridge.

## Key facts

- For: owners and developers with dead sliders, menus or forms and a $.browser console error
- Cause: code calling jQuery.browser, removed in jQuery 1.9
- Trigger: WordPress 5.5 stopped loading jQuery Migrate by default
- Real fix: update or replace the plugin or theme, or use feature detection
- Stopgap: the Enable jQuery Migrate Helper plugin, tested on staging first
- Avoid: rolling WordPress or jQuery back to an old version
- Help: WordPress support or emergency support

If your browser console shows an error like `Cannot read properties of undefined (reading 'msie')`, or older wording such as `jQuery.browser is undefined`, a script on your site is using a feature jQuery removed more than a decade ago. **The real fix is to update or replace the code that uses it.**

> **Quick answer**
Find the file in the console, update or replace that plugin or theme, and use feature detection in your own code. Use the jQuery Migrate Helper plugin only as a dated stopgap, and never roll WordPress back.

## Why does it happen?

`jQuery.browser` reported which browser the visitor used. It was deprecated and then removed in jQuery 1.9 because browser sniffing is unreliable. WordPress core has moved to jQuery 3.x, so any plugin, theme or bundled library that still calls `$.browser` now breaks, and the rest of that script usually stops running, which is why sliders, menus or forms go dead.

Core used to load the jQuery Migrate helper, which hid problems like this. It stopped doing so by default in WordPress 5.5, which is when many old sites started showing the error.

## How do I find and fix it?

1. **Confirm the error.** Open the page, then developer tools and the **Console** tab, and reload.
2. **Read the file and line number.** A path under `wp-content/plugins/some-plugin/` names the plugin or theme.
3. **Update the plugin or theme.** Most maintained products have already removed `$.browser`.
4. **Replace it if unmaintained,** with an alternative.
5. **If you own the code,** replace the browser check with feature detection.

You can also search the code. From the WordPress root over SSH:

```
grep -rn "\.browser" wp-content/plugins wp-content/themes --include=*.js
```

Expect some harmless matches, such as unrelated properties named browser. Look for `$.browser` and `jQuery.browser`.

## What does the old code look like, and what replaces it?

Old scripts sniff the browser to work around quirks that no longer exist:

```
if ($.browser.msie && $.browser.version < 9) {
  // old workaround
}
```

Internet Explorer is no longer supported by current WordPress, so in nearly every case the branch can simply be deleted. Where behaviour depends on a capability, test the capability:

```
if ('IntersectionObserver' in window) {
  // use it
} else {
  // fall back
}
```

| Question | Use |
|---|---|
| Does the browser support a CSS feature? | `CSS.supports('display', 'grid')` |
| Is the screen small? | `window.matchMedia('(max-width: 600px)').matches` |
| Does an API exist? | `'IntersectionObserver' in window` |

Make these changes in a child theme or your own plugin, never in a third-party plugin's files, because the next update would overwrite them.

_One failing call can silence the whole script_

## Why is only one script failing when many load?

JavaScript errors stop only the script they occur in. If a theme bundles its scripts into one file, a single `$.browser` call can take everything with it, which is why a menu, a slider and a form all die at once. Check the console for the first error, not the last: later messages are often consequences.

## What if I need a temporary bridge?

If the site is broken now and you cannot fix the code today, the **Enable jQuery Migrate Helper** plugin from the WordPress.org directory restores the older compatibility layer.

> **Stopgap rules**
Test on a staging copy first: it restores many removed APIs but do not assume it covers everything. Do not roll WordPress or jQuery back, which trades a script error for known security problems. Put a date on removing it.

## Worked example: a slider that stopped after an update

A site's homepage slider stops after a WordPress update, and the console points at a file in an old slider plugin. Note the file, find the plugin, check for an update, read its changelog for jQuery compatibility and test the update on staging. If the plugin has not been updated for years, pick a maintained replacement, rebuild the slider there and remove the old plugin. If a campaign is running, the migrate helper buys a few days.

## How do I check the fix worked, and stop it returning?

Reload with the console open and confirm the error is gone and the feature works. Check other pages that use the same script, test as a logged-out visitor in a private window, clear caches and re-test on a phone.

- Update plugins and themes on a schedule, not only when something breaks. See the [maintenance checklist](/wordpress-maintenance-checklist).
- Remove abandoned plugins.
- Test updates on a copy first with the console open.
- Keep a short list of your own custom scripts and what they depend on.

## Which fix suits which situation?

| Situation | Best fix |
|---|---|
| A maintained plugin or theme | Update it |
| An abandoned plugin | Replace it with a maintained one |
| Your own custom script | Feature detection in a child theme or custom plugin |
| Site broken now, campaign running | Migrate helper on staging as a dated stopgap |

## When to ask for help

An error in one script can hide others behind it. If the fix means editing a theme, or the site is down, [ask an engineer](/wordpress-support) or, if it is costing you money now, [call for emergency support](/wordpress-emergency-support).

**Dead slider or menu?**
An engineer can find the responsible script.
[Post a project](/post-project)
[Call the help desk: (804) 375-4450](tel:+18043754450)

## Frequently asked questions

### What does the $.browser error mean?

Some code is calling jQuery.browser, which jQuery removed in version 1.9. Modern WordPress ships a newer jQuery, so the call fails and the script stops.

### Should I install a jQuery Migrate plugin?

Only as a short-term bridge while you replace the old code. It restores many removed jQuery APIs, but test on a staging copy, and plan to fix or replace the plugin or theme.

### Why did the error only start after a WordPress update?

Newer WordPress ships a newer jQuery and no longer loads the migrate helper by default, so code that relied on removed features began failing.

### Is it safe to edit the plugin file myself?

It works, but the next plugin update will overwrite your change. Fix it in a child theme or custom plugin, or replace the plugin.

### How do I find which file is responsible?

Open the page, then developer tools and the Console tab, and reload. The error shows the script file and line number, and the path tells you which plugin or theme is responsible.

### Can I search the code for $.browser?

Yes. From the WordPress root over SSH, grep the plugins and themes folders for .browser in JavaScript files. Expect some harmless matches and look for $.browser and jQuery.browser.

### What replaces the browser check in my own code?

Feature detection: test what the browser can do instead of which browser it is. Use CSS.supports() for CSS, 'IntersectionObserver' in window for APIs and window.matchMedia for screen sizes.

### Why did my slider, menu and form all die at once?

JavaScript errors stop only the script they occur in, but if a theme bundles its scripts into one file a single $.browser call takes everything with it. Check the first console error, not the last.

### Should I roll back WordPress or jQuery?

No. That trades a script error for known security problems. Fix or replace the code instead.

### How do I check the fix worked?

Reload with the console open and confirm the error is gone and the feature works. Check other pages that use the same script, test as a logged-out visitor in a private window, clear caches and re-test on a phone.

### What if the plugin is no longer maintained?

Pick a maintained replacement, rebuild the feature there and remove the old plugin. If a campaign is running, the migrate helper can bridge a few days while you do it.
