WordPress admin sidebar sizing

Give the WordPress sidebar the width it actually needs

Custom Menu Width resizes the admin sidebar to fit long labels or a translated interface, and automatically repositions any third-party panel still expecting WordPress's hardcoded 160px.

  • One width value, in px, em, rem or %.
  • Applies only above WordPress's own 961px collapse breakpoint.
  • Detects and repositions elements hardcoded to the old 160px width.
  • Fixes a real stacking bug that can make the sidebar look broken.
Admin Sidebar SizingCustom Menu Width
Width200pxemrem%Reset
Third-party panels anchored to 160px get repositioned automatically.
Sidebar resizedLabels fit on one line, panels stay aligned.
Active
Quick answer

What does Custom Menu Width do?

When the admin_menu_width module is active, TOWP_Admin_Menu_Width injects a stylesheet on admin_head that resizes the sidebar, its submenu panels and the content area's margin to a chosen width, scoped inside a min-width: 961px media query so WordPress's own responsive collapse and mobile layout still take over below that. Because WordPress has no CSS variable or hook for the sidebar's width, other plugins commonly hardcode its default 160px into their own fixed-position panels; a companion script enqueued through admin_enqueue_scripts detects any element whose left edge lands exactly on that number and repositions it to match the new width, using a MutationObserver to catch panels, like Query Monitor's, that get built by script well after the page loads.

The "labels don't fit" problem

WordPress's sidebar width is fixed for one language

A width tuned for one language and a handful of core menu items rarely matches what a real, plugin-heavy, translated install actually needs.

Long labels wrap onto two lines

The default width was sized for English menu labels of ordinary length; a translated site, or one where plugins have added entries with longer names, ends up with labels wrapping awkwardly.

A fixed width doesn't fit every screen

On a smaller screen, a sidebar that's wider than it needs to be takes working space that's hard to justify; on a larger one, the same width can feel cramped.

A dedicated WordPress solution

One width, applied everywhere it needs to be

The module doesn't just widen the sidebar; it also finds and fixes everything else that assumed the sidebar would stay at its default size.

A single width, four units

Set the sidebar's width in px, em, rem or % from one field, applied consistently across the menu, its submenus and the content area.

Other plugins compensated automatically

A heuristic script finds fixed-position panels still anchored to WordPress's hardcoded 160px and moves them to match the new width, without a list of plugin names to maintain.

A genuine stacking bug fixed

The sidebar's background and its items sit at very different stacking levels in WordPress core; the module aligns them so a third-party panel can no longer render sandwiched between the two.

Verified feature set

A resize that brings everything else with it

Every capability below is present in the supplied PHP class, its compensation script and settings registration.

Responsive-aware

Only above 961px

The custom width sits inside a min-width: 961px media query, so WordPress's own icon-only collapse and mobile layout still work exactly as before.

min-width: 961pxRespects WP breakpoints
Universal compensation

Detects, not a plugin list

A script looks for any fixed or absolute element whose left edge sits exactly on WordPress's hardcoded 160px, rather than checking against a maintained list of plugin names.

Heuristic detectionNo plugin list
Handles dynamic panels

A MutationObserver watches for new elements

Panels built by script well after page load, like Query Monitor's, still get detected and repositioned correctly.

MutationObserverLate-rendered panels
Stacking fix

Aligns two mismatched z-index levels

WordPress renders the sidebar's background and its items at very different stacking levels; the module raises the background so nothing can render caught between them.

z-index alignment#adminmenuback
Known compensations

Query Monitor and Freemius, by name

Two specific, widely-installed integrations get an explicit CSS fix in addition to the general JS detection, since both anchor fixed elements to the old 160px.

Query MonitorFreemius
Practical use cases

Where a wider sidebar helps most

The module supports the situations where WordPress's default width was never really tuned for.

Translated or localized sites

Widen the sidebar so translated menu labels, often longer than their English originals, display on a single line.

Sites with many plugin-added menu items

Accommodate the longer labels that accumulate as more plugins each add their own top-level or submenu entry.

Smaller or larger screens

Narrow the sidebar to reclaim working space on a smaller display, or widen it comfortably on a large monitor.

Operational benefits

A wider sidebar without collateral damage

The module combines resizing, universal compatibility and a real bug fix in one setting.

Labels that finally fitA wider sidebar means menu labels display cleanly instead of wrapping onto a second line.
No compatibility list to maintainThe detection script works from the symptom, not a name, so it covers plugins nobody has specifically accounted for yet.
A cleaner-looking sidebarFixing the underlying stacking issue means a wider menu doesn't risk looking visually broken.
Fits the screen it's actually used onA width tuned to the actual screen, rather than WordPress's one-size-fits-all default, makes better use of available space either way.
Performance behaviour

Bounded checks, nothing when unset

The verified implementation keeps the compensation script's work fast and scoped.

No effect below the default width

If the width value isn't set, or is zero or invalid, neither the CSS nor the compensation script gets added at all.

The compensation script only scans nearby elements

The detection walks three levels below <body>, not the entire page, keeping each sweep fast.

Deliberately throttled rechecks

The script rechecks shortly after load and again once contents settle, rather than running continuously, keeping overhead bounded.

Security implementation

Validated input, layout-only script access

The code validates the width before use and keeps the compensation script strictly to positioning.

01

Value and unit are both validated

The width has to pass is_numeric() and be greater than zero, and the unit gets checked against a fixed list of four options.

02

Output is escaped

The generated width value passes through esc_attr() before being placed into the inline stylesheet.

03

The compensation script only touches layout properties

It sets left, right and width with inline styles; it never touches content, attributes, or anything beyond positioning.

04

Administrator-only configuration

Only an administrator with access to TheOneWP settings can change the sidebar's width.

Verified compatibility

Built to work around WordPress's blind spot

The supplied code integrates through APIs present in WordPress core. No compatibility claim beyond the verified implementation is assumed.

Responsive behaviour

Respects WordPress's own breakpoints

The custom width only applies above 961px, leaving WordPress's native auto-fold and mobile layouts untouched below that.

961pxauto-fold preserved
Third-party panels

Detected by position, not by name

Any fixed or absolute element whose left edge matches WordPress's hardcoded 160px gets repositioned, covering plugins the module has never specifically been told about.

Position-based detectionAny plugin
Explicit fixes

Query Monitor and Freemius

Both get a dedicated CSS rule in addition to the general script, since they're widely installed and anchor fixed panels to the old width.

Query MonitorFreemius
Solution comparison

TheOneWP versus common alternatives

Compare the verified Custom Menu Width implementation with a typical hand-written admin CSS snippet.

CapabilityTheOneWP Custom Menu WidthOther common solutions
Resizing the sidebar One field, four units, applied consistentlyUsually requires a custom admin CSS snippet
Third-party plugin panels Detected automatically by position, no list neededA CSS snippet only fixes the plugins someone thought to name
Responsive behaviour WordPress's own collapse and mobile layout stay intactA blanket width override can break the native mobile menu
The sidebar stacking bug Fixed as part of the same moduleNot something a simple width override typically addresses
Administration One field inside TheOneWP settingsRequires editing a child theme's CSS file directly
Recommended workflow

Resize the sidebar in four steps

Size around the longest label the menu actually has to display.

01

Enable Custom Menu Width

Activate the module from the TheOneWP Backend settings tab.

02

Set a width and unit

Enter a value and choose px, em, rem or %, based on whether labels are wrapping or the sidebar simply feels too narrow or too wide.

03

Check the sidebar and any third-party panels

Reload an admin screen and look at any developer tools or notice panels from other plugins to confirm they still align correctly.

04

Adjust or reset as needed

Fine-tune the value, or use Reset to return to WordPress's own default width.

Best practices

Resize with the longest label in mind

A good sidebar width is set around what the menu actually needs to display, not a round number.

01

Widen enough to fit the longest label

Check the menu item with the longest label, often from a translated string or a plugin's own naming, and size around that.

02

Test on the smallest supported screen

A width that looks fine on a large monitor might feel cramped for content on a smaller one, so check both.

03

Give a third-party panel a moment to settle

A newly opened panel like Query Monitor's may reposition itself a moment after appearing, which is the compensation script catching up, not a bug.

04

Reset if a specific panel still looks wrong

If some other fixed element still doesn't align after resizing, that panel likely isn't anchored to the standard 160px in the way the detection expects.

Common mistakes

Avoid assumptions that cause confusion

The module's detection logic and responsive scope are both deliberate and worth understanding.

Assuming every plugin panel gets fixed automatically

The detection targets elements whose left edge sits exactly on WordPress's hardcoded 160px; a panel positioned differently won't match that specific pattern.

Expecting the custom width on small screens

The setting only applies above 961px by design, so WordPress's own collapsed and mobile layouts look exactly as they did before below that.

Setting an extreme width value

A very wide or very narrow sidebar can make the admin harder to use rather than easier, even though the labels display cleanly.

Frequently asked questions

Custom Menu Width FAQ

These answers come directly from the verified class, its compensation script and settings registration.

What does Custom Menu Width do?

It resizes the WordPress admin sidebar to a chosen width, in px, em, rem or %, and automatically repositions other plugins' fixed-position panels that assumed the sidebar would stay at its default 160px.

Why would I need to widen the sidebar?

Usually because menu labels are wrapping onto two lines, often on a translated site or one where several plugins have added entries with longer names.

Does this break WordPress's mobile or collapsed sidebar?

No. The custom width only applies above a 961px viewport, so WordPress's own icon-only collapse and mobile layout work exactly as they did before.

How does the module know which other plugins to fix?

It doesn't rely on a list of plugin names. A script detects any fixed or absolute element whose left edge sits exactly on WordPress's hardcoded 160px and repositions it to match.

Does the compensation work for panels that load after the page, like Query Monitor's?

Yes. A MutationObserver watches for newly added elements, so panels built by script well after load still get detected and repositioned.

What's the stacking bug this module fixes?

WordPress renders the sidebar's background and its items at very different z-index levels; a third-party panel with a z-index between the two can render sandwiched inside the sidebar. The module aligns the levels to prevent that.

Are any specific plugins handled explicitly?

Yes. Query Monitor and Freemius both get a dedicated CSS fix in addition to the general detection script, since they're widely installed.

What happens if I don't set a width value?

Nothing changes. Without a valid, positive value, neither the CSS nor the compensation script gets added to the page.

Can I undo a width change?

Yes, using the field's Reset button, which returns the value to WordPress's own default.

Does this affect the front end of the site?

No. Both the CSS and the compensation script only run inside wp-admin.

Stop watching menu labels wrap onto two lines.Give the sidebar the width it needs.

Use Custom Menu Width to resize the admin sidebar and automatically keep other plugins' panels aligned with it.