brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: set CONCATENATE_SCRIPTS false in wp-config when the admin looks broken

Wp-Config
~/tips/tip-wp-config-concatenate-scripts

define( 'CONCATENATE_SCRIPTS', false );

Loads admin scripts one by one so you can find the failing file.

Buttons in the dashboard do nothing, the media window won’t open, and the browser console complains about one enormous script from load-scripts.php.

In the admin area WordPress bundles its scripts and styles into a few combined requests. When something in front of the site mangles or blocks those, large parts of the dashboard stop working. Switch the bundling off:

define( 'CONCATENATE_SCRIPTS', false );

Reload with the cache bypassed. Each script now loads on its own, so the browser’s Network tab shows exactly which file gets a 403, a 404 or half a response.

If the dashboard works again, you’ve learned the bundle was the problem. Typical suspects are a firewall rule that dislikes the long query string, a CDN or proxy caching a broken response, or a core file that didn’t upload completely. Fix that, then remove the line.

It only affects the admin and login screens; the public side doesn’t concatenate this way. Pages there that are broken need a different explanation, probably a theme or plugin.

SCRIPT_DEBUG also turns concatenation off, but it swaps in the unminified files as well, which changes two things at once. For this particular hunt I’d rather change just one. Leaving the constant in place permanently costs a pile of extra requests in the dashboard, which you’d notice on a slow connection.

Further reading: WordPress developer docs: wp-config.php

More Wp-Config tips ls -ld wp-content wp-content/plugins index.php define( 'WP_TEMP_DIR', '/var/www/example.com/tmp' ); define( 'CORE_UPGRADE_SKIP_NEW_BUNDLED', true ); define( 'ALTERNATE_WP_CRON', true ); wp config list WP_DEBUG All Wp-Config tips (7) All topics

Link