erebussymk
Member
Posted 5 months ago #
I am getting error like this in my sitemap.
XML Parsing Error: junk after document element
Location: http://bikramkawan.com.np/sitemap.xml
Line Number 2, Column 1:<b>Warning</b>: Invalid argument supplied for foreach() in <b>/hermes/bosweb/web201/b2012/ipg.pri2sh/bikramkawan/wp-includes/query.php</b> on line <b>2746</b>
^
Currently Not generating sitemap for new post. Will this effect in google crawling my old post.
http://wordpress.org/extend/plugins/google-sitemap-generator/
in /wp-includes/query.php change this
/`/ Always sanitize
foreach ( $this->posts as $i => $post ) {
$this->posts[$i] = sanitize_post( $post, 'raw' );
}`
to
/`/ Sanitize before caching so it'll only get done once
for ( $i = 0; $i < $this->post_count; $i++ ) {
$this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
}`
Poor hack I know!
// Always sanitize
foreach ( $this->posts as $i => $post ) {
$this->posts[$i] = sanitize_post( $post, 'raw' );
}
to
// Sanitize before caching so it'll only get done once
for ( $i = 0; $i < $this->post_count; $i++ ) {
$this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
}
in /wp-includes/query.php change this
// Always sanitize
foreach ( $this->posts as $i => $post ) {
$this->posts[$i] = sanitize_post( $post, 'raw' );
}
to
// Sanitize before caching so it'll only get done once
for ( $i = 0; $i < $this->post_count; $i++ ) {
$this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
}
erebussymk
Member
Posted 5 months ago #
I am having this in multiple sites.
I really do not want to hack the WP code (now on 3.3) of all these sites and get stuck to the maintenance.
Will there be a plugin fix soon ?
Thanks,
I tried it but I am getting lots of 404 in almost al .xml-files.
How can I force regeneration of the whole lot ?
Thanks,
There is no regeneration, since they are all generated on the fly. Could you post the URL to a not-working example?
Your sitemap looks good and passes all online validation tools. Please resubmit it in the Google Webmaster Tools, i guess Google is still reporting the errors because of the previous problems.
I did resubmit already. And again.
I'll give it an other day to see if it is picking up/reporting on ald stuff.
Thanks,
erebussymk
Member
Posted 5 months ago #
Will it be wise tweaking wp code ?? Will it hamper in future ?
Will it be wise tweaking wp code ?? Will it hamper in future ?
No not clever at all. hence my earlier comment
I really do not want to hack the WP code (now on 3.3) of all these sites and get stuck to the maintenance.
Will there be a plugin fix soon ?
It has been fixed in the beta version.