Title: Fatal error. (Debug log attached.)
Last modified: January 31, 2023

---

# Fatal error. (Debug log attached.)

 *  Resolved [tinkerjet](https://wordpress.org/support/users/tinkerjet/)
 * (@tinkerjet)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-debug-log-attached/)
 * PHP version: 8.1.14
 * Symptoms: Website throws a critical error when logged in and viewing the page
   that dynamically loads blog posts.
 * `Warning: Attempt to read property "post_type" on null in /home/.../public_html/
   wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/SeoPreview.php on
   line 93
   Warning: Attempt to read property "labels" on null in /home/.../public_html/
   wp-includes/post.php on line 2028Fatal error: Uncaught Error: Attempt to assign
   property "labels" on null in /home/.../public_html/wp-includes/post.php:2028 
   Stack trace: #0 /home/.../public_html/wp-includes/post.php(1984): _get_custom_object_labels()#
   1 /home/.../public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Standalone/
   SeoPreview.php(93): get_post_type_labels() #2 /home/.../public_html/wp-content/
   plugins/all-in-one-seo-pack/app/Common/Standalone/SeoPreview.php(67): AIOSEO\
   Plugin\Common\Standalone\SeoPreview->getVueData() #3 /home/.../public_html/wp-
   includes/class-wp-hook.php(308): AIOSEO\Plugin\Common\Standalone\SeoPreview->
   init() #4 /home/.../public_html/wp-includes/class-wp-hook.php(332): WP_Hook->
   apply_filters() #5 /home/.../public_html/wp-includes/plugin.php(565): WP_Hook-
   >do_action() #6 /home/.../public_html/wp-includes/class-wp.php(797): do_action_ref_array()#
   7 /home/.../public_html/wp-includes/functions.php(1332): WP->main() #8 /home/.../
   public_html/wp-blog-header.php(16): wp() #9 /home/.../public_html/index.php(17):
   require('…') #10 {main} thrown in /home/.../public_html/wp-includes/post.php 
   on line 2028There has been a critical error on this website.Learn more about 
   troubleshooting WordPress.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [J Burns](https://wordpress.org/support/users/subiewrx/)
 * (@subiewrx)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-debug-log-attached/#post-16431044)
 * Hi @tinkerjet,
 * Thank you for including the additional information and I’m sorry you’re experiencing
   an issue here.
   In order to clear the error, please add the following code snippet–
 *     ```wp-block-code
       add_action( 'init', function() {
       	if ( ! function_exists( 'aioseo' ) ) {
       		return;
       	}
   
       	if ( version_compare( '4.3.1', aioseo()->version, '<' ) ) {
       		return;
       	}
   
       	remove_action( 'wp', [ aioseo()->standalone->seoPreview, 'init' ] );
       }, 100);
       ```
   
 * Please use the [WPCode ](https://wordpress.org/plugins/insert-headers-and-footers/)
   plugin to easily add the snippet to your website.
 * Feel free to reach out if you have any other questions.
 * Thanks!
 *  Thread Starter [tinkerjet](https://wordpress.org/support/users/tinkerjet/)
 * (@tinkerjet)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-debug-log-attached/#post-16431320)
 * Thank you. The snippet you provided works, but I also achieved the same fix by
   commenting out the offending line. (Line 93 in the SeoPreview.php file.)
 * Do I need to keep the fix permanently?
 * Thank you.
 *  [J Burns](https://wordpress.org/support/users/subiewrx/)
 * (@subiewrx)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-debug-log-attached/#post-16434339)
 * Hi [@tinkerjet](https://wordpress.org/support/users/tinkerjet/),
 * You will not need to keep this permanently.
 * A fix is scheduled to be released in v4.3.1.
 * We appreciate your patience and apologize for any inconvenience that this has
   caused.
 * Thanks!
 *  Plugin Support [Steve M](https://wordpress.org/support/users/wpsmort/)
 * (@wpsmort)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-debug-log-attached/#post-16481897)
 * Hi [@tinkerjet](https://wordpress.org/support/users/tinkerjet/) ,
 * I wanted to let you know that we released All in One SEO Pro v4.3.1.1 today which
   fixes this issue.
 * Please update to the latest version to get this fix.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal error. (Debug log attached.)’ is closed to new replies.

 * ![](https://ps.w.org/all-in-one-seo-pack/assets/icon.svg?rev=2443290)
 * [All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic](https://wordpress.org/plugins/all-in-one-seo-pack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/all-in-one-seo-pack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-seo-pack/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-seo-pack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-seo-pack/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Steve M](https://wordpress.org/support/users/wpsmort/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-error-debug-log-attached/#post-16481897)
 * Status: resolved