Back to Community

Resolving Common Fatal Errors in Yoast Duplicate Post

52 threads Sep 9, 2025 PluginYoast duplicate post

Content

Yoast Duplicate Post is a powerful tool for WordPress site management, but like any complex plugin, it can sometimes encounter errors that cause conflicts or even crash your site. Based on community reports, this guide covers the most common fatal errors and their solutions.

Common Error 1: Function Redeclaration or Class Not Found

Error Example: Fatal error: Cannot redeclare duplicate_post_is_current_user_allowed_to_copy()... or Fatal error: Uncaught Error: Class 'YoastWPDuplicate_PostAdminOptions_Page' not found...

Why it happens: This typically occurs when your theme or another plugin has bundled an older version of the Duplicate Post code, leading to a conflict when the standalone plugin is activated. The 'Class not found' error can also indicate a incomplete plugin update where the new vendor files were not properly installed.

Solution:

  1. Check if your theme (e.g., OptimizePress) has its own duplication functionality. If so, you may not need the standalone plugin.
  2. If you require the plugin's features, contact your theme's support and ask if they can remove their bundled version to prevent the conflict.
  3. For the 'Class not found' error, try a clean reinstall: completely delete the duplicate-post folder via FTP/SFTP and then install a fresh copy from the WordPress repository.

Common Error 2: Argument Type Mismatch (TypeError)

Error Example: Argument 1 passed to ... must be an instance of WP_Post, null/string/bool given...

Why it happens: This was a known bug introduced in version 4.0 of the plugin. The code expected a WP_Post object but was sometimes receiving a different data type (like a user role string or a boolean) from other plugins or themes, particularly on admin screens not related to posts.

Solution:

  1. Update the plugin. The Yoast Duplicate Post team released patches for these specific issues. Ensure you are running the latest version.
  2. If updating doesn't resolve the issue, it may be due to a lingering conflict. The fastest way to check is a conflict test:
    1. Deactivate all other plugins except Yoast Duplicate Post.
    2. Switch to a default WordPress theme like Twenty Twenty-One.
    3. See if the error disappears. If it does, reactivate your plugins and theme one by one to identify the culprit. Popular conflict sources include membership/role plugins (like Members), page builders, and other admin utilities.

Common Error 3: Database Error on Settings Save

Error Example: WordPress database error: [Column ‘option_value’ cannot be null] UPDATE wp_options SET option_value = NULL...

Why it happens: This error suggests the plugin is trying to save a NULL value to the database for a setting that should not be empty, which violates the database structure.

Solution: This is often resolved in subsequent plugin updates. Update to the latest version. If the problem persists, you may need to manually check and repair your WordPress database tables using a tool like phpMyAdmin or your hosting provider's database management interface.

Common Error 4: PHP 8.2 Compatibility Error

Error Example: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given...

Why it happens: Newer versions of PHP (8.2+) have stricter type checking. The error occurs when the plugin tries to use the in_array() function with a null value instead of an array.

Solution:

  1. Update the plugin. The development team is aware of this issue and has fixed it in later releases.
  2. If an update is not immediately available, a workaround is to access your database (via phpMyAdmin or a similar tool), find the wp_options table, and delete the duplicate_post_taxonomies_blacklist row. Warning: Always back up your database before making direct changes.

General Troubleshooting Steps

For any error not listed above, follow these universal steps to isolate the cause:

  1. Update Everything: Ensure WordPress, your theme, and all plugins are updated to their latest versions. Many conflicts are resolved through updates.
  2. Conflict Test: As described above, deactivate all other plugins and switch to a default theme. This is the most reliable way to determine if the error is a conflict.
  3. Check Server Logs: Your web hosting provider likely has error logs (e.g., in cPanel) that can provide more detailed information about a fatal error than the white screen you see on the front end.
  4. Manual Plugin Reset: If your site is crashed and you cannot access the admin area, use FTP or your host's file manager to rename the duplicate-post folder inside wp-content/plugins/ to something like duplicate-post-OFF. This will deactivate the plugin and allow you to log back in.

Remember, when reporting bugs, providing the exact error message from your server logs and a list of your active plugins is incredibly helpful for developers to diagnose issues.

Related Support Threads Support