So I have a user content generated website and sometimes I need to redirect users if I deleted content that violates our website rules. My problem is that Google does not like redirecting and it reduces my crawl budget and rankings on Google. How should I redirect users if the content was deleted? I have a page with content id ... https://www.website.com/?id=1 If 1 is not found I redirect users using <?php header('location: ./'); ?> I am looking for a better solution.
maybe in this case it is better to refuse redirects and respond with a 404 error, additionally, you can make a redirect with a delay to a java script
You can change in code ..... When any content mark as deleted then write there few line (Add one more row like "admin_response" in database) like this content is deleted because of this reason. After this you dont need to redirect user ...... Just fetch there tha if admin_response is not equal to deleted show content else show deleted message and put there links or button for go to home page or go to this page.
When you delete web pages, it's essential to set up 301 redirects to relevant and similar pages on your site to maintain SEO value and provide a seamless user experience. Use a 301 redirect plugin or edit your website's .htaccess file to create the redirects, ensuring that users and search engines are automatically directed to the most appropriate alternative content. Regularly monitor and update these redirects as your site evolves to keep it user-friendly and SEO-friendly.
Don't delete users, inactivate them. That way you can keep the good content they produced on your website and delete the violations/spam posts.
I work with websites that get many articles. And some of them may be unwanted or undesirable. Instead of deleting pages, opt to do a content change while keeping the page location. This will be considered as an "Update" in Google and you won't annoy or lose users.
To redirect a deleted pages use 301 redirection to the URL which gains more traffic to the website. Or redirect the deleted URL to home page URL. The website must not contain 404 pages as it impact the SEO rankings. Make sure your website doesn't have 404 pages and all 404 pages must be redirected to the active pages.
It is quite easy to redirect them via the .htaccess file. You can learn more from this link: https://help.dreamhost.com/hc/en-us...ct-and-rewrite-my-URLs-with-an-htaccess-file-