I disabled a lot of plugins, but some of them required by the page to work:
- Advanced Custom Fields
- Advanced Custom Fields PRO
- Ajax Search for WooCommerce
- SEOPress
- WooCommerce
- WooCommerce Brands
- Woocommerce CSV Import
- WooCommerce Extra Charges To Payment Gateway (Standard)
- WooCommerce Measurement Price Calculator
- WooCommerce Multilingual
- Woocommerce Onsale Page
- WooCommerce PDF Invoices & Packing Slips
- WooCommerce Weight Based Shipping
- WPML Media
- WPML Multilingual CMS
- WPML Sticky Links
- WPML String Translation
- WPML Translation Management
After this, I got the following error message:
Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/wp-content/themes/csercsics/base.php:11) in /var/www/html/wp-content/plugins/wp-seopress/inc/functions/sitemap/template-xml-sitemaps.php on line 5
Warning: Cannot modify header information – headers already sent by (output started at /var/www/html/wp-content/themes/csercsics/base.php:11) in /var/www/html/wp-content/plugins/wp-seopress/inc/functions/sitemap/template-xml-sitemaps.php on line 8
base.php: https://pastebin.com/9px1Tg53
Moreover the XML sitemap is styled just like my regular theme.
Commenting out
//XML
Header('Content-type: text/xml');
//Robots
Header("X-Robots-Tag: noindex", true);
Solves the Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/themes/csercsics/base.php:11) in /var/www/html/wp-content/plugins/wp-seopress/inc/functions/sitemap/template-xml-sitemaps.php on line 5
error message, but the page is still HTML.
After enabling the plugins one-by-one, I found the conflict with JCH Optimize (https://hu.www.ads-software.com/plugins/jch-optimize/)