CloudFlare Flexible SSL making Sitemap https instead of http
I'm importing this from this free forum post: https://wordpress.org/support/topic/cloudflare-flexible-ssl-making-sitemap-https?replies=3#post-7664695
User reported: "I have enabled flexible ssl with CloudFlare so I can use wp-admin with https. Unfortunately this has changed my sitemap to use https instead of http.
The site and home url are set to http in wp-config.php
Please tell me how to change it back or add an option to force http or https in the yoast plugin."
Then user resolved with: "I fixed this myself, there should really be an option to do this in the plugin
Replace htpcguides.com with your desired home and siteurl
In MySQL or phpadmin"
update wp_options set option_value='http://www.htpcguides.com' where option_name='siteurl';
update wp_options set option_value='http://www.htpcguides.com' where option_name='home';
I believe that this is likely also the solution to several other free plugin tickets we've seen that were struggling with this even when everything else looked correct.
I have not personally tested this patch, due to not having a site running CF's Flex SSL, but the user reports that this solved.
I'm not sure we can patch this within our plugin, since adding those fields would introduce a LOT of ways for people to break things. Ideally, those could be handled by the CloudFlare plugin for WordPress. However, I'm noting this all here so that we know what's going on and how to sort it out. Maybe there is a way we can patch for it, I don't know.
I think we've been over this before and essentially not our problem. There are simply too many ways people can configure it and want it to work, so if we try to be "smart" about this it would just be backfiring.
Sitemaps simply use links that WP API functions generate. If someone customizes that behavior it is up to them to ensure that API returns desired results.