Error 500 When Web Stories URL Ends with “/amp/”
-
Hello everyone,
I hope you’re doing well. I’m currently facing an issue on my WordPress website and I could really use some assistance. Whenever I access a web story with a URL ending in “/amp/”, I encounter a 500 error. However, when I access the same web story URL without the “/amp/” ending, the error doesn’t occur.
With wp_debug enabled, I’m seeing the following error message:
Fatal error: Uncaught Error: Call to a member function setAttribute() on null in /var/www/html/wp-content/plugins/web-stories/includes/AMP/Traits/Sanitization_Utils.php:52 Stack trace: #0 /var/www/html/wp-content/plugins/web-stories/includes/AMP/Integration/AMP_Story_Sanitizer.php(52): Google\Web_Stories\AMP\Integration\AMP_Story_Sanitizer->transform_html_start_tag() #1 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(135): Google\Web_Stories\AMP\Integration\AMP_Story_Sanitizer->sanitize() #2 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(100): AMPforWP\AMPVendor\AMP_Content_Sanitizer::sanitize() #3 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(60): AMPforWP\AMPVendor\AMP_Content->sanitize() #4 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(26): AMPforWP\AMPVendor\AMP_Content->transform() #5 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-post-template.php(328): AMPforWP\AMPVendor\AMP_Content->__construct() #6 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-post-template.php(122): AMPforWP\AMPVendor\AMP_Post_Template->build_post_content() #7 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/amp.php(94): AMPforWP\AMPVendor\AMP_Post_Template->__construct() #8 /var/www/html/wp-includes/class-wp-hook.php(310): AMPforWP\AMPVendor\amp_render() #9 /var/www/html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters() #10 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action() #11 /var/www/html/wp-includes/template-loader.php(13): do_action() #12 /var/www/html/wp-blog-header.php(19): require_once('...') #13 /var/www/html/index.php(17): require('...') #14 {main} thrown in /var/www/html/wp-content/plugins/web-stories/includes/AMP/Traits/Sanitization_Utils.php on line 52
It seems that the error is originating from the “Sanitization_Utils.php” file within the “web-stories” plugin. The error occurs when the URL ends with “/amp/”. Interestingly, this error is not present when the URL doesn’t have the “/amp/” ending.
I’m not entirely sure what might be causing this issue. If anyone has encountered a similar problem or has any insights into a possible solution, I would greatly appreciate your assistance.
Thank you in advance for your time and help.
- The topic ‘Error 500 When Web Stories URL Ends with “/amp/”’ is closed to new replies.