• Resolved akil76

    (@akil76)


    when i try to add example.com/sitemap-news.xml in search console its says We encountered an error while trying to access your Sitemap. Please ensure that your Sitemap follows our guidelines and can be accessed at the location you provided, and then resubmit.

    and when i search this site map its shows This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <error>
    wp_die
    <title>
    <![CDATA[ WordPress &rsaquo; Error ]]>
    </title>
    <message>
    <![CDATA[ Error: This is not a valid feed template. ]]>
    </message>
    <data>
    <status>404</status>
    </data>
    </error>

    i tried re saved permalinks ,update and refereh posts and pages cleared caches ut nothing working ..

Viewing 9 replies - 1 through 9 (of 9 total)
  • Have you enabled the Google News Sitemap option on Settings > Reading? If so, can you go to Settings > Google News and use the button “Check for conflicts”?

    Thread Starter akil76

    (@akil76)

    Hi, thanks for the fast reply , after enabling this its worked :).. i have another question .. now i added myself sitemap in Robots.txt .. want to add the two site map manually in robots.txt ? 1. example.com/sitemap.xml 2. example.com/sitemap-news.xml ? or it will automatically added on Robots.txt ?i seen its not automatically added so i added only one sitemap: example.com/sitemap.xml ! so i want to remove that one too ?

    Stay safe
    Regards,

    Thread Starter akil76

    (@akil76)

    and also its only showing 5 posts ! its possible to increase that ? in example.com/sitremap-news.xml

    The plugin can add both sitemaps to robots.txt automatically but only if you let WordPress itself handle robots.txt requests. This means (1) that you need to remove the static robots.txt file from your site root and (2) there are no htaccess (or nginx) rules that prevent any robots.txt requests from reaching index.php (which should be the case on default installations)

    What I suggest is:
    1. rename your static robots.txt file to robots.bak
    2. visit your site’s /robots.txt in your browser to see if you get a valid response.

    If you get a 404 page response or error, your easiest option is to just rename robots.bak to robots.txt again and add the two sitemaps manually:

    
    Sitemap: https://example.com/sitemap.xml
    Sitemap: https://example.com/sitemap-news.xml
    

    (convert https://example.com to match your site domain and protocol)

    But if all is well, your browser should show the default WordPress generated robots.txt with the sitemaps added by the plugin:

    
    # XML Sitemap & Google News version 5.2.7 - https://status301.net/wordpress-plugins/xml-sitemap-feed/
    Sitemap: https://demo.status301.net/sitemap.xml
    Sitemap: https://demo.status301.net/sitemap-news.xml
    
    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php
    

    Next, you can open your old robots.bak file and copy all custom rules that you wish to add to the new robots.txt (not a real file!) by going to Settings > Reading in your WordPress admin, and pasting your custom rules in the field Additional robots.txt rules.

    Attention: these custom rules will be automatically appended to the robots.txt response, below the default rules. You may need to modify them to make sense in that context!

    Thread Starter akil76

    (@akil76)

    Hi,Sorry i didnt understand well …iam not a developer …

    Now i added both site maps on Robots.txt example now my Robots.txt looks like

    Sitemap: https://demo.status301.net/sitemap.xml
    Sitemap: https://demo.status301.net/sitemap-news.xml
    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php

    and also checked both sitemaps by searching https://www.mysite.com/sitemap.xml and https://www.mysite.com/sitemap-news.xml bot are now loading fine ….

    Now everyhting is okay ? or i want to do something !!!

    Regards

    • This reply was modified 4 years, 7 months ago by akil76.

    Hi, if there are no other rules in your robots.txt file, then the best option is to simply delete it. WordPress can manage your robots.txt for you dynamically. There is no need for a static robots.txt file…

    But if you wish to keep your robots.txt file, then make sure to replace https://demo.status301.net in your example with your actual site address.

    and also its only showing 5 posts ! its possible to increase that ? in example.com/sitremap-news.xml

    The news sitemap only contains posts from the last 48 hours. If there are more posts published in the last two days, then they should all appear in the news sitemap.

    Thread Starter akil76

    (@akil76)

    Are you saying i want to update the Robots.txt in Subdomains ? i didn’t have any Subdomains and i edited the Robots.txt using Yoast Seo plugin in Yoast SEO -> Tools -> File Editor actually i just edited an WordPress Default Robots.txt usig the plugin ..!!!

    Are you saying i want to update the Robots.txt in Subdomains ?

    No that’s not what I’m saying. The code you posted includes the wrong domain (demo.status301.net) and that should not be in your robots.txt file.

    It would really be helpful if you could share a link to your site so I can see what is actually happening, instead of going back and forth with example code with fictitious domains…

    i edited the Robots.txt using Yoast Seo plugin in Yoast SEO -> Tools -> File Editor actually i just edited an WordPress Default Robots.txt usig the plugin ..!!!

    There is no need to use the Yoast file editor if you do not have any custom robots.txt rules to add. Just witch off Yoast robots.txt editor and delete the file.

    Thread Starter akil76

    (@akil76)

    i deactivated the Yoast Plugin and checked the Robots.txt its works normal like

    Sitemap: https://mywebsite.com/sitemap.xml
    Sitemap: https://mywebsite.com/sitemap-news.xml
    User-agent: *
    Disallow: /wp-admin/
    Allow: /wp-admin/admin-ajax.php

    And i submitted the both sitemaps on Search Console Both are successfuly crawled…and both sitemaps are works fine
    .. now everything is fine

    Regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Search Console Issue’ is closed to new replies.