Redirect 404 pages in wordpress - wordpress

Few weeks back I made changes to my wordpress site ctageory slug redirecting https://example.com/category/catname/ to https://example.com/catname/ to strip the 'category' base slug. Due to some restraints again I changed it back to normal as https://example.com/category/catname/
Now I am having number of 404 category archive pages crawl errors in Google Webmaster Tools, the errors like below:
1. https://example.com/catname/page/1/?
2. https://example.com/catname/page/2/?
How can I redirect these /catname/page/(.*) to /category/catname/page/$1. I have tried redirecting with htaccess and wordpress redirect plugins but nothing seemed to be working and resultedmost browsers saying "too many redirects" and the page didn't load.
I have been struggling with it. Any help shall be appreciable.
Thank you very much

Related

Removed Images showing Server 404 instead of website 404 wordpress

My website had an image /wp-content/uploads/2020/12/abc.jpg.webp
I deleted the image now it's showing a blank page with text
"404 Not Found
openresty/1.17.8.2"
I have installed the 404 to 301 plugin, it is supposed to redirect to the homepage. all other redirects are working fine but for images and attachments, it's not working. the white page that appears is not from my theme. please check this image
Redirecting 404 pages to homepage is an SEO anti-pattern: https://yoast.com/seo-anti-patterns-301-redirect-all-your-404s-to-your-homepage/
Instead of redirecting 404s to homepage, try to create a 404 page with a better design. Since you're using WordPress, there should be a bunch of plugins and themes that let you do that.
(BTW, if you really want to do that, try looking up your plugin settings or simply switch to another "404 to 301" or redirect manager plugin that support file/image redirects)

numbers after wordpress urls not showing 404

I just notice a bug in my WordPress sites when I am adding any number after a blog post or page URL it's not showing any 404 error or its just a valid page
like I have a site
https://www.gryffin.com/ so if I visiting this URL https://www.gryffin.com/features/ and adding any number after this URL https://www.gryffin.com/features/98989 like this it should show the error of page not exist but it's not giving this error I check other WordPress sites have the same issue I think its not good on SEO point of view can anybody give me solution of it.

How to fix these 404 errors in WordPress?

So, I've been looking for a way to sort out these 404 errors on a WordPress site. This log is compiled using the Redirection plugin for WP. Anyway, how would you go about sorting out these 404 errors? Any advice would be greatly appreciated.
So, these mostly appear to be bots scraping the site (atleast it appears that way from the User Agent Info.) Where are they getting these URL's?
What you can do you can redirect these links to the home page best way to make it SEO friendly there are so many ways you can archive this by adding code in htaccess or this plugin can be most useful in this issue:
All 404 Redirect to Homepage
Redirect 404 Error Page to Homepage or Custom Page with Logs

Can't throw a 404 error with urls that start with a question mark

So recently I updated my site from Joomla to Wordpress. (best decision of my life...seriously)
All of my old Joomla links were formatted with a ? right after my domain name like this: www.example.com/?blah
Now when I switched to Wordpress, I'm using pretty URLs that are formatted like this : www.example.com/blah
Now googles got all the old Joomla urls still indexed so when searched for it still gives you the old URLs. In my head those Joomla URLs should throw a 404 error. But they don't! They just display the homepage.
For Example - if you go to www.example.com/blah it will throw a 404 error because that page doesn't exist, however if you go to www.example.com/?blah it will show that URL in the address bar, but display the homepage despite the fact that that page does not exist either.
So my questions are:
1) will google eventually dump those URLs in favor of my Wordpress ones? How will that hurt my SEO and page rank - does google still see that as a valid page and keep it in its index?
2) How do I force 404 errors for those URLs that don't exist anymore with a question mark.
(1) You'll have to get your sitemap redone and have GoogleBot reindex your site. Google Webmaster Tools should be the place to do that.
(2) You could redirect the invalid links to a 404 page using your .htaccess file

Migrating Wordpress Permalinks from postname to post_id/postname

My blog's been up for a year or so, and 90% of our traffic comes from Google, so I want to make sure that I'm handling this permalink change properly. I recently read on Wordpress' codex that including the numerical %post_id% at the beginning of your permalinks can greatly reduce the stress on your database, when a post or page is being fetched. So, I decided to change my permalink structure from /%postname%/ to /%post_id%/postname/.
Now, if I type in, or click on a link to my site in google that looks like this - http://blog.com/cool-post/, it seems to redirect to my new structure: http://blog.com/34424/cool-post/ without a hitch. I'm trying to figure out whether I need to use a 301 redirect plugin or not. I would like to think that search engines like Google will see the same "flawless" redirection that I'm seeing. There doesn't seem to be any broken links. Just looking to confirm that I'll be okay after this change.
Thanks
WordPress handles canonical redirects for you by sending 301 Moved Permanently status codes appropriately. That status code ensures Google will only index your posts by the new URLs (i.e. with the post IDs in your permalinks). I've not used a redirection plugin for a while and my sites have been indexed similarly just fine.

Resources