XML sitemap – critical errors on site
-
Hello,
I switched to SEOPress today and I am having critical errors trying to get XML sitemaps to display.
Site is Astra theme, Elementor builder, and WP Super Cache (I prevented caching of xml per the seopress support document)
Using debug mode, at first I was getting:
XML Parsing Error: junk after document element
Location: https://www.mywebsite.ca/sitemaps.xml
Line Number 2, Column 1:
<b>Deprecated</b>:? str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in <b>/home/mysitedirectory/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase2.php</b> on line <b>54</b><br />^Using a patched version of the wp-cache-phase1.php file from the wp-super-cache GitHub I solved this issue, but now I get the following error when trying to open the posts-sitemap1.xml and pages-sitemap1.xml (the categories and tags xml links open fine)
Fatal error: Uncaught Exception: Failed to parse time string (<span class=”modified-category”></span>) at position 0 (<): Unexpected character in /home/mysitedirectory/public_html/wp-content/plugins/wp-seopress/templates/sitemap/single.php:168 Stack trace: #0 /home/mysitedirectory/public_html/wp-content/plugins/wp-seopress/templates/sitemap/single.php(168): DateTime->__construct() #1 /home/mysitedirectory/public_html/wp-content/plugins/wp-seopress/src/Services/Sitemap/Render/Single.php(111): include_once(‘/home/mysitedirectory/…’) #2 /home/mysitedirectory/public_html/wp-content/plugins/wp-seopress/src/Actions/Sitemap/Render.php(81): SEOPress\Services\Sitemap\Render\Single->render() #3 /home/mysitedirectory/public_html/wp-includes/class-wp-hook.php(310): SEOPress\Actions\Sitemap\Render->render() #4 /home/mysitedirectory/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters() #5 /home/mysitedirectory/public_html/wp-includes/plugin.php(565): WP_Hook->do_action() #6 /home/mysitedirectory/public_html/wp-includes/class-wp-query.php(1881): do_action_ref_array() #7 /home/mysitedirectory/public_html/wp-includes/class-wp-query.php(3800): WP_Query->get_posts() #8 /home/mysitedirectory/public_html/wp-includes/class-wp.php(662): WP_Query->query() #9 /home/mysitedirectory/public_html/wp-includes/class-wp.php(782): WP->query_posts() #10 /home/mysitedirectory/public_html/wp-includes/functions.php(1335): WP->main() #11 /home/mysitedirectory/public_html/wp-blog-header.php(16): wp() #12 /home/mysitedirectory/public_html/index.php(17): require(‘/home/mysitedirectory/…’) #13 {main} thrown in /home/mysitedirectory/public_html/wp-content/plugins/wp-seopress/templates/sitemap/single.php on line 168
Since this mentions categories, I’m also having an issue where the archive and post pages are showing the category link in the upper left corner of the page on the frontend, just at the top of the <body> section, so it shows above the header. This links appears and disappears with activating and deactivating the seopress plugin.
- The topic ‘XML sitemap – critical errors on site’ is closed to new replies.