redirect attachments to image file – sitemaps

#226494
  • Resolved Spiros Kalimeris
    Rank Math pro

    Hello
    First of all i followed the instructions here https://rankmath.com/kb/filters-hooks-api-developer/#how-to-add-code-snippets-to-rank-math-php and it broke my site at the point of creating rank-math-php file. Thankfully it was restored when i removed it.
    So first question is about this if there is a safe way to do this.

    Second i would like to ask about the sitemaps. I currently use jetpack sitemap which by default includes attachments pages in it and i obviously do not prefer that. I have made them no-index a couple of weeks ago with rank math but they are still on the jetpack sitemap. Should they still be there?

    Now i have added the redirection option to the original post that rank math offers, but this is not so ok because there are many orphan images on my site. Is it bad for seo to include attachments in it which redirect? Because doing an audit with ahrefs gives the “Noindex page in sitemap” error.

    Finally i am thinking of starting using rank math sitemaps and i would like you to guide me with a safe way to migrate. This is because removing attachments from the sitemap is included as an option to rank math. It will not affect the actual images correct?

    I wuld appreciate your feedback to all of the above which are kind of connected together.

    Thanks

Viewing 15 replies - 1 through 15 (of 50 total)
  • Prabhat
    Rank Math agency

    Hello,

    Thank you for contacting us.

    First of all i followed the instructions here https://rankmath.com/kb/filters-hooks-api-developer/#how-to-add-code-snippets-to-rank-math-php and it broke my site at the point of creating rank-math-php file. Thankfully it was restored when i removed it.
    So first question is about this if there is a safe way to do this.

    You can also add the snippets/filters of Rank Math inside your theme’s functions.php file.

    However, could you confirm what error you got here and which snippet you were trying to add?

    Second i would like to ask about the sitemaps. I currently use jetpack sitemap which by default includes attachments pages in it and i obviously do not prefer that. I have made them no-index a couple of weeks ago with rank math but they are still on the jetpack sitemap. Should they still be there?

    We do not have experience on how the JetPack sitemap works, but if you use Rank Math Sitemaps and mark any post/page/CPT as No Index, that would be immediately removed from the sitemaps.

    Now i have added the redirection option to the original post that rank math offers, but this is not so ok because there are many orphan images on my site. Is it bad for seo to include attachments in it which redirect? Because doing an audit with ahrefs gives the “Noindex page in sitemap” error.

    Could you confirm if you’re referring to the Redirect Attachments option or you have redirected the post containing the images?

    Could you please share the URL of any such page that you’ve redirected?

    Redirecting attachment pages are a good way of saving your crawl budget, since the attachment pages are thin contents, they waste your website’s crawl budget.

    Finally i am thinking of starting using rank math sitemaps and i would like you to guide me with a safe way to migrate. This is because removing attachments from the sitemap is included as an option to rank math. It will not affect the actual images correct?

    Enabling the Rank Math sitemaps would instantly generate sitemaps for your website, based on the settings that you would have configured.

    You can enable the Sitemaps module from your WordPress admin area > Rank Math > Dashboard, and after that, you can configure the settings for the sitemaps from Rank Math > Sitemap Settings.

    Please have a look at this tutorial guide for more details: https://rankmath.com/kb/configure-sitemaps/

    Regarding the second part of your question, could you please describe what you mean when you said “It will not affect the actual images correct”?

    Looking forward to hearing back from you.

    Thank you.

    1. Ένα σφάλμα τύπου E_COMPILE_ERROR εντοπίστηκε στη γραμμή 264 του αρχείου /srv/htdocs/wp-content/plugins/seo-by-rank-math/rank-math.php. Κωδικός σφάλματος: require_once(): Failed opening required ‘/srv/htdocs/wp-content/themes/neve/rank-math.php’ (include_path=’/:.’)

    Some of it is in greek but i hope you get the picture of the error. The problem happened when i created the folder rank-math.php. I do not know why as i am not into coding e.t.c.

    2. I have now checked the option to redirect attachment urls to the original post. This is alink that redirects to the home page as it is an orphan attachment ανεργια. And here is a link that redirects to its containing post γενικευμένη αγχώδης διαταραχή

    I would like from you an answer about the no-index error i mentioned in the audit. Also about the transition for the sitemaps. Should i submit the rankmath sitemaps on google console first and the remove the jetpack. How long after?

    Hello
    Waiting for a response.

    Prabhat
    Rank Math agency

    Hello,

    We’re sorry for the unfortunate delay.

    1. The issue here might be related to file permissions or conflicts. As I mentioned previously, you can also safely add the filters/codes in your theme’s functions.php file or use a plugin like Code Snippets. Here’s an article regarding it: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    For the error, 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

    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/

    2. As you’ve redirected the attachment pages to their parent/containing posts, there should not be a No Index error on the parent page itself (unless it is manually applied). Also, both the links that you’ve shared in your previous reply, redirects to your homepage.

    Could you share some screenshots of the ahrefs report along with the affected URLs, so that we can have a closer look at the issue?

    For the sitemaps, once you enable the sitemaps of Rank Math, you can disable the JetPack sitemaps and remove them from your Google Search Console account. Further, add the Rank Math sitemaps to the Google Search Console.

    When Google would crawl your website again, it would be able to find the Rank Math sitemaps.

    Hope that helps.

    Thank you.

    Ok thanks just a quick question is about if the change of sitemaps will affect the google rankings.

    Prabhat
    Rank Math agency

    Hello,

    Sitemaps are a way through which bots navigate through your website. In any case, the rankings of the already indexed posts/pages would not be affected by sitemaps.

    The sitemaps should not get cached and should be available to the bots. All the new URLs of contents in the sitemaps should be visible to the bots so that they can crawl/index them, to ensure that, the sitemaps should be excluded from your caching plugin.

    Please have a look at this guide for more details:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    Hope that helps.

    Thank you.

    Hello
    I activated the rank math sitemaps but it ends up to a page not found.

    https://kalimeristherapist.com/sitemap_index.xml

    This is not normal right?

    Hello,

    That is not the expected behavior. Could you please follow these steps?

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    I hope that helps.

    Thank you.

    Well thanks, taking the first step seems to solve the problem but..

    1.The xml url takes forever to load. When i cut out the https:// part at the address bar, then it loads instantly. This is not normal as well right?

    2.There is no image sitemap.

    3. Some pages seem to be missing (but this may be explained if i look thoroughly about no-index issues e.t.c.)

    Ankit
    Rank Math business

    Hello,

    The sitemap appears to be heavily cached, because I am still seeing the old sitemap page.

    Here is the screenshot for your reference:
    https://i.rankmath.com/yUis6a

    Please kindly exclude the Sitemap files of the Rank Math plugin in your caching plugin.

    And it looks like you also have a physical robots.txt file present inside your root directory. Please consider deleting it because Rank Math will create the virtual one.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi
    But this is not the rankmath sitemap that you posted. The rank math sitemap does not load and does not contain images, why is this?
    I also am not sure this answers the question because I have checked the swift performance plugin i use for caching and it does exclude sitemap files. I do not know if any other caching already exists in my configuration.
    I must remind you i am not an expert and after the mistake i initially posted on the ticket, i think i should be cautious. I do not know how to modify the robots file. What if there is an breakdown again?

    Ankit
    Rank Math business

    Hello,

    But this is not the rankmath sitemap that you posted. The rank math sitemap does not load and does not contain images, why is this?
    I also am not sure this answers the question because I have checked the swift performance plugin i use for caching and it does exclude sitemap files. I do not know if any other caching already exists in my configuration.

    The sitemap that is showing on your website is being generated by jetpack plugin, If you haven’t disabled the sitemap option from the the plugin please kindly do that.

    I must remind you i am not an expert and after the mistake i initially posted on the ticket, i think i should be cautious. I do not know how to modify the robots file. What if there is an breakdown again?

    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

    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.

    But if i remove the jetpack sitemap the images will not be indexed. Can i submit both sitemaps rankmath and jetpack to google console at the same time? And have them both active? At least until you have your closer look?

    Hello
    Sorry, but if you could answer so that we proceed to resolve the issues. Thanks

    Ankit
    Rank Math business

    Hello,

    If you are using a second SEO plugin or a Sitemap plugin though – you should disable that. only one sitemap plugin should be activated.

    But if I remove the jetpack sitemap the images will not be indexed.

    Rank also supports that you can turn on the “images in sitemap” option if you want to index the images. you can do that from WP Dashboard > Rank Math > Sitemap settings

    Looking forward to helping you. 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.

Viewing 15 replies - 1 through 15 (of 50 total)

The ticket ‘redirect attachments to image file – sitemaps’ is closed to new replies.