Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1318670

    Hi Guys,

    hope you are doing well.

    I have a problem regarding the RSS Feed. First of all i included pages in my RSS Feed with a simple JS Code i put into the functions.php. This works fine and my feed now includes blog posts and pages.

    But there are some strange, numeric URLs inside the feed now. As far as i can tell they are old URLs of pages that do not exist anymore in my WordPress Backend, because some of those URLs have a title – but not all of them. Some are just URLs with numbers. I already checked the trash bin in pages, it’s emtpy, respectively i cannot find it, because i did not delete any pages in the last time.

    The URLs look something like this:
    – domain.tld/635/
    – domain.tld/628/
    – domain.tld/162/
    – …
    domain.tld/enfold-child/

    As far as i know every WordPress Page has a number. But usually you do not use this number URL, but a URL with words inside it. But where are they coming from and how can i get rid of them? Has this something to do with Caching? And how can i remove the domain.tld/enfold-child/ URL from the feed?

    Thanks in advance!

    #1318942

    Hey hammerseo,

    Thank you for the inquiry.

    We are not really sure how or where the rss retrieves those links or pages. Did you manually modify the database before? Have you tried to manually search the database for those pages using the numbers presented in the URL? Try to clean the database using a database optimization plugin and remove the transients, maybe this will help remove the ghost pages.

    // https://wordpress.org/plugins/wp-optimize/

    Make sure to create a site backup or restore point before doing anything to the database.

    Best regards,
    Ismael

    #1319023

    Hey Ismael,

    interesting. I did not modify the database before. But i think your approach is the way to go.

    Since I am using another caching plugin i did not try wp-otimize, but i tried removing those URLs manually from the database. I went to my db and inside the “posts” table, looked up the URLs and removed them one by one. When i looked at my feed again they were gone. It worked.

    But then i saw that the main menu/navigation on my site was also gone :) I tried refreshing the cache and different browsers, but did not got the menu back until i switched back to my old data base backup. Now i can switch back and forth, new database has those broken URLs removed but no menu/navigation, old db is of course stillt he same but the menu is working. Any idea why this happened and what i can do about it? I could try removing each link manually until i face the same problem again, but maybe you know why this happens … ?

    Thanks once again!

    Best regards

    • This reply was modified 3 years, 1 month ago by hammerseo.
    #1319442

    Hi,

    But then i saw that the main menu/navigation on my site was also gone

    You might have removed database entries for the menu items. Did you check the name of searched entries?

    Where did you get the RSS script? Please place the script on pastebin.com and post the link in the private field.

    Best regards,
    Ismael

    #1319547

    Hello,

    well, I just went into my database > posts and searched for the URLs, e.g. i searched for 628, 627, 633 and so on. All of the URLs that are insinde my feed but should not be there. Each time i got only one result so i thought that must be right. There is even an /enfold-child/ URL but i did not touch it, since i was scared to break something.

    I found the RSS script by searching on this topic. I do not remember exactly where, i think somewhere on stackexchange. There where some old suggestions that did not work properly, this one was the newest answer i found from 2020. You can see the pastebin link in the private field.

    Best regards!

    • This reply was modified 3 years, 1 month ago by hammerseo.
    #1319816

    Hi,

    Did you check the name of the entries? Please search for the entries again in the database, click on the returned result and provide us a screenshot so that we know which entry is it.

    According to the documentation, the snippet above will enable all post type in your rss feed including post nav, attachment etc, and post type created by other plugins. You should remove the filter above if you do not intend to include all post type in your rss feed.

    Best regards,
    Ismael

    #1321400

    Hi Ismael,

    as usual you gave me just the right hint.

    WordPress does use multiple post types and my script included all of them. But i only needed ‘post’ and ‘page’ post types. Your first suggestion to solve the problem with deleting db entries was also right, but since the db entries included parts of the WordPress navigation it broke the navigation.

    I solved the problem with putting this code inside my functions.php:

    add_filter('request', 'feed_request');
    function feed_request($qv){
        $rss_post_types = array('post', 'page');
        if(isset($qv['feed']) && !isset($qv['post_type']))
            $qv['post_type'] = $rss_post_types;
        return $qv;
    }

    This way only pages and posts are included into the feed.

    Thanks for your awesome support once again!

    Best Regards

    • This reply was modified 3 years, 1 month ago by hammerseo.
    #1321576

    Hi,

    No problem. Glad to know that the issue with the rss feed has been fixed. And glad we could be of help. Please let us know in another thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘RSS Feed old and numeric URLs’ is closed to new replies.