Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘disable_embeds_rewrites’ not found or invalid function name in /var/www/vnengineer.net/public_html/wp-includes/class-wp-hook.php on line 324

The error message you’re seeing, Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'disable_embeds_rewrites' not found or invalid function name, indicates that WordPress is attempting to call a function named disable_embeds_rewrites that either does not exist or has not been defined properly.

Here are some steps to troubleshoot and fix this issue:

  1. Check the Code:
    • Review your theme’s functions.php file or any custom plugins to see if the disable_embeds_rewrites function is defined.
    • Ensure that the function name is spelled correctly and matches exactly where it’s being called.
  2. Disable Plugins:
    • Temporarily deactivate all your plugins to see if the issue persists. If the warning disappears, reactivate each plugin one by one to identify which plugin is causing the issue.
  3. Theme Check:
    • Switch to a default WordPress theme (like Twenty Twenty-One) to determine if the issue is theme-related. If the warning goes away, the problem lies within your theme.
  4. Update WordPress:
    • Ensure that you are using the latest version of WordPress. Sometimes, functions and hooks are deprecated or replaced in newer versions.
  5. Search for Code Hooks:
    • Search for any add_action or add_filter calls in your theme or plugins that are referencing disable_embeds_rewrites. These should only reference valid, defined functions.
  6. Correct the Function Call:
    • If you find a place where disable_embeds_rewrites is referenced and it’s incorrect, either remove it or replace it with the correct function.
  7. Restore from Backup:
    • If you have a recent backup of your site files and database, consider restoring from a backup taken before this issue started.