Addendum: The photos come from https://aurandus.com/wp-content/plugins/aawp/assets/img/icon-check-prime.svg , how can I exclude them from the sitemap? I deactivated the logo briefly, the photos have disappeared from the sitemap, but the sitemap still loads slowly. But it must have something to do with photos, because when I deactivate the photos completely in the sitemap, everything loads quickly. I have add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’); to make the problem clearer.
Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
The Prime logo image is being added to your content as <img>
tag, that’s why they are getting included in your post sitemap.
However, to exclude them from your sitemap, you may need to use and customize this filter:
/**
* Filter images to be included for the post in XML sitemap.
*
* @param array $images Array of image items.
* @param int $post_id ID of the post.
*/
add_filter( 'rank_math/sitemap/urlimages', function( $images, $post_id ){
return $images;
}, 10, 2);
And here’s a guide on how you can add a filter to your website:
https://rankmath.com/kb/filters-hooks-api-developer/
Also, please check your site’s configuration if there are some PHP values that are too low and which you should increase to fix the sitemap loading issue.
You can get in touch with your web host and ask them to set the following values (if not yet):
PHP Memory Limit: 512M
Max input time: 150
PHP time limit: 120
PHP max input variables: 1000
Hope that helps.
Thank you.
I have the right values:
PHP Memory Limit: 512M
Max input time: 150
PHP time limit: 120
PHP max input variables: 1000
and also disabled this image from aawp plugin, and there was no change in sitemap loading time.
I don´t know how to change
/**
* Filter images to be included for the post in XML sitemap.
*
* @param array $images Array of image items.
* @param int $post_id ID of the post.
*/
add_filter( ‘rank_math/sitemap/urlimages’, function( $images, $post_id ){
return $images;
}, 10, 2);
To solve this problem.
The only thing i know is: When i disable images from rank math sitemap everything is loading fast. Something from AAWP is loading into the sitemap which is causing this loading problem. This only happens when aawp isn´t finding a valid asin number.
Hello,
The filter code will allow you to validate each image path that comes in your sitemap. Here’s an example of its usage:
add_filter( 'rank_math/sitemap/urlimages', function( $images, $post_id ){
foreach($images as $image ){
if($image['src'] == 'https://aurandus.com/wp-content/plugins/aawp/assets/img/icon-check-prime.svg'){
return false;
}
}
return $images;
}, 10, 2);
The image URL in the code will be excluded from the sitemap.
Or, you can do so like this which will allow you to exclude any AAWP image assets:
add_filter( 'rank_math/sitemap/urlimages', function( $images, $post_id ){
foreach($images as $image ){
if ((strpos($image['src'], 'https://aurandus.com/wp-content/plugins/aawp/asssets') !== false)) {
return false;
}
}
return $images;
}, 10, 2);
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
Both codes sadly didn´t fixed the loading issue.
I added 2 invalid ASIN Numbers into https://aurandus.com/test-beitrag/
Per invalid ASIN Number the Sitemap https://aurandus.com/post-sitemap1.xml is loading slower.
add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’); is added to disable sitemap cache so you can see the problem better.
I really don´t know how to fix this issue, i am in contact with AAWP Plugin too.
Hello,
Thank you for your patience.
In this case, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
![Sensitive Data Section](https://i.mythemeshop.com/SphEG0+)
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
I added sensitive Data.
I also added https://aurandus.com/test-beitrag/ 2 non existent aawp products so you can see the sitemap loading error better.
add_filter( ‘rank_math/sitemap/enable_caching’, ‘__return_false’); is in functions.php
Please tell me what you have done after finished looking on my site
Thank you
Any News on my Sitemap issue?
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
We deeply apologize for the delay in response.
We checked your website and we can’t get the filter code to work. We have gone ahead and shared this ticket with our developer to check this issue further.
We should get back to you shortly. Appreciate your time and patience in the meantime.
Thank you.
Hey any news? And i have a security question.
Someone logged in 3 hours ago with following IP:
IP: 122.179.50.47 Hostname: abts-kk-dynamic-047.50.179.122.airtelbroadband.in
Is this from your team?
Hello,
We can’t confirm yet if that IP is coming from our team but 3 days ago, our developer applied the code below and the issue has been fixed:
add_filter( 'rank_math/sitemap/urlimages', function( $images, $post_id ){
foreach($images as $key => $image ){
if ((strpos($image['src'], 'plugins/aawp/assets/') !== false) || ( ! is_array( $image ) && strpos($image, 'plugins/aawp/assets/') !== false)) {
unset( $images[$key] );
}
}
return $images;
}, 10, 2);
Can you please confirm from your end?
We are looking froward to helping you.
Those aawp pictures are not in the sitemap now but somehow the sitemap https://aurandus.com/post-sitemap1.xml is still loading slow when not available aawp shortcodes are embedded
Hello. I got an Login again 4.11.2023 07:58:18 (3 hours 15 mins ago). Is this from you? Somehow the communication is very poor. I don’t know exactly what will be done when and the problem still exists. If there is no solution, please let me know. This is a live site, Christmas sales are coming up and experimenting on my live site could hurt me, especially since I’ve already posted my login details for a month. Thank you
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.