Short answer: “Cannot redeclare function …” is a fatal PHP error meaning the same function name was defined twice. PHP refuses to run, so the site (and often the admin) goes down. The log points straight at both locations.
Read the two locations
Enable WP_DEBUG_LOG and open /wp-content/debug.log. The error names the function and the file/line where the second declaration happened, and usually references the first. Those two paths are your answer — you just need to remove or rename one of them.
The common causes
- A code snippet pasted twice — into
functions.phpand also into a snippets plugin. - Copying a function from a tutorial that already exists in your theme.
- Two plugins shipping a helper with the same generic name (for example a common utility function without a prefix).
- A child theme redeclaring a function from the parent without a
function_exists()guard.
Fix it over SFTP
- Open the file named on the second declaration line and remove the duplicate, or wrap it in
if (! function_exists('name')) { ... }. - If two plugins clash, deactivate one by renaming its folder in
/wp-content/pluginsand decide whether you need both. - If a snippet was pasted twice, delete the duplicate copy.
Verify
Reload the site and the admin, and confirm the feature that used that function still works. If the clash was between two plugins, check whether the one you kept covers what the other provided, so you are not left with a missing feature after removing the conflict.
WP REPAIR INCIDENT STANDARD
How to narrow the fault without guessing
Cannot redeclare identifies two definitions with the same function name. The log paths show where each copy loaded, which is safer than adding a guard without understanding why duplicate code exists.
Record the function name and both file/line locations.
Determine whether the code is duplicated, bundled by two plugins or loaded twice by an include.
Remove the unintended copy or namespace/prefix the custom code.
Use function_exists only when optional override behaviour is genuinely intended.
What must be verified
- Only one intended definition loads.
- The dependent feature works with the final load order.
- Cache, opcode cache and restart do not bring the fatal back.
Official technical sources
Continue the diagnosis
This guide explains the diagnosis. If the site is affected now, the intervention should preserve a rollback path and verify the real business journey.
See the emergency repair service →