Support » Fixing WordPress » Warning: Invalid argument supplied for foreach() (pleae help)

  • Hello there, hope you can help me with this please.

    I have a problem regarding “400 crawl errors” on webmaster tools that caused my rankings to disappear.
    The crawl errors happened on the 15th which is the same day my rankings disappeared.

    I’m lost here and have no idea what to do about it. Any help would be really great. Anyway, this is one of links that’s causing an issue.

    There’s another 3 more doing the same thing but all of my webpages have disappeared off Google search across all my websites. Now when i log into my dashboard i see a warning message that reads…

    Warning: Invalid argument supplied for foreach() in /home/retsced/public_html/ on line 2746

    I went into my hosting directory to “query.php” but there doesn’t seem to be anything wrong there, but to be fair, i haven’t much knowledge to begin with. This message is showing on all my websites.

    The day this all happened i was creating a new post on one of my sites. Just as i hit the “publish button” i noticed i hadn’t set the right category for the post and instinctively changed the category whilst the post was in the middle of publishing.

    I know nothing about this stuff but it seemed like the request was sent twice. After that i got the errors you see from the link above.

    I had looked around my website but cannot see where the problem lies.

    Can anyone give me an idea of where i can start to resolve this issue.
    Unfortunately i don’t know anybody who can help me, so even a referral to another source that can help fix it would be greatly appreciated.

    I have little hair left as it is and could really use some help please.

    Thank you so much for your time.


Viewing 7 replies - 1 through 7 (of 7 total)
  • this is a permalink issue. visit

    check your link have /%CAtagory%/ inbrtween. if you want a fix for google redirect that url to new one.

    Thanks for your reply Pankaj, but i don’t think it’s a specific link that is causing the problem.

    The following message is on all of my websites…

    Warning: Invalid argument supplied for foreach() in /home/retsced/public_html/ on line 2746

    Although I’m sure it’s a permalink problem, i need to fix the above warning message as all my rankings dropped and i got the crawl errors at the same time this warning message appeared in my dashboard on all 4 of my websites.

    One of my sites has 76 articles on it but i haven’t got it set up in webmaster tools, i cringe to think how many crawl errors that site has 🙂

    that warning will disappear and its take some time. seems your website permalink structure was wrong when google crawl that. so fix the permalink structure. see from which page that error url is linked. if issue found fix then resubmit sitemap via webmaster tool. it will solve your problem. it may take 1-2 week time

    Thanks for your help Pankaj, i will look into fixing my permalink structure. I really appreciate you taking the time out.

    Thank you.

    I’m back, and i still can’t get to the root of this problem. When i change my permalink structure to “/%category%/%postname%/” the url i get errors in Google with, the rest of my links don’t work because they are still directed to the permalink format “/%postname%/” .. now i know this is obvious and i just have to redirect those url’s to the new structure.

    The problem is though, it won’t redirect and i get a warning saying….

    “Warning: Cannot modify header information – headers already sent by (output started at /home/retsced/public_html/ in /home/retsced/public_html/ on line 423

    Any more suggestions would be great guys, this is really getting to me now. Anyways, off to bed now, haven’t really slept in last two days. All the best, and thanks again for your help Pankaj, i really appreciate it.

    Your theme may be doing it. I had added some code to a custom theme which was only supposed to run a query under certain conditions, but since I had coded it incorrectly, it ran the query when it did not make sense, and therefore generated this same error at the top of the HTML code from every page.

    If it’s not the theme, I’d try disabling all your plugins and see if it goes away, then reactivate each plugin until it reappears.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Warning: Invalid argument supplied for foreach() (pleae help)’ is closed to new replies.