Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

How to Fix Crawl Errors in Google Search console or Google WebmasterTool

If you have moved your website links recently or deleted them, then you may see crawl error in your Google Webmaster Tools or Google Search Console(new name of the tool).
You will see two type of errors on the Crawl Errors page.
Site errors: In a normal operating site you generally won’t have these errors. Also as per google if they see large number of Site errors for your website they will try to notify you in the form of a message no matter how big or small your site is.  These type of errors generally comes when your site is down for long time or is not reachable to google bots because of issues like DNS errors or excessive page load time.
URL errors: These are the most common errors you will find for a website. It can be because of multiple reasons like you moved or renamed the pages, or you have permanently deleted a post.
These errors may impact your search engine rankings as google don’t want the users to go to pages that doesn’t exists.
So let’s see how you can fix these URL errors.
Once you login to the Google Webmaster Tools and select the verified property you should see the URL errors marked for your site.
It has two tabs Desktop and Smartphone that shows the errors in respective version of your website.
Select the error and you will see the website link which is broken. It can be your old post which you have moved or deleted.
If you are a developer you can redirect the pages of the broken links to working pages.
But if you don’t want to mess with the code you can install a free plugin called Redirection . Below we will see how you can install and use this plugin.
  • For installing the plugin go to Dashboard> Plugins> Add New
  • Search the plugin “Redirection” and click Install > Activate.
  • After you have installed the plugin go to Dashboard> Tools> Redirection.
  • Once on the Redirection settings pages select “Redirects” from the top.
  • In the “Source URL” copy/paste the URL for which you are getting error.
  • In the “Target URL” copy/paste the working URL.

  • Click Add Redirect.
You can also redirect all your broken URLs to  your Homepage. But if the post is available on different link, then it’s recommended that you redirect the broken link to new working link of that post. This will enhance the user experience
Last step is that you go back to the Google Webmaster Tools page. Select the URL you just corrected and click on “Mark as Fixed” .
Hope this post helps you. Do let me know your opinion in comments section.

Solved: How to remove the AWS EC2 instance name from the URL?

After installing the website using AWS image you would have noticed that the URL still have reference of the EC2.
It can be in post URLs like
http://ec2-65-231-192-68.compute-1.amazonaws.com/your-post-name
How to get rid of that?
The easiest way to do it is by going to your wordpress dashboard.
In the dashboard go to Settings>General.
In the General Settings page you will see two parameters, WordPress Address (URL) and Site Address (URL).  Change them to your website name e.g. http://yourwebsite.com .
Finally save it. Your post URLs should now look like
http://yourwebsite.com/your-post-name
In Bitnami WordPress Image you will find that WordPress Address (URL) and Site Address (URL) will be greyed out and it won’t allow to modify them. In that case you will have to modify wp-config.php file.
For bitnami image the file location is /opt/bitnami/apps/wordpress/htdocs/wp-config.php. Keep a copy of old file and modify the current file
cp -p /opt/bitnami/apps/wordpress/htdocs/wp-config.php /opt/bitnami/apps/wordpress/htdocs/wp-config.php.oldsudo vi /opt/bitnami/apps/wordpress/htdocs/wp-config.php
Modify two lines which has entries for WP_HOME and WP_SITEURL . They  should now look like.
define('WP_HOME','http://yourwebsite.com');define('WP_SITEURL','http://yourwebsite.com');
If your website is having SSL certificate and you want all your posts and pages to have https. Than the above entries should look like.

define('WP_HOME','https://yourwebsite.com');define('WP_SITEURL','https://yourwebsite.com');
Finally save the file.
When you refresh the page it should now show your desired URL.
If the URL is still not showing correctly and you are sure that you have modified the file correctly than restart apache.
sudo /opt/bitnami/ctlscript.sh restart apache
This should get you done!

Solved: How to delete revisions of wordpress posts?

You may have noticed that wordpress keep revisions of your old posts.
These revisions can be useful if you want to go back to an older version of a post. But if you are sure that you no longer need those old versions of post than it’s best to get rid of them.
Deleting the old posts will give you precious space which you can use for posting new articles. Also it will make your database querying fast.
Here we will discuss about how to delete old revisions.
If you don’t like plugins you can follow these simple steps. Else, directly go to Step 4 to check plugins for doing this.
1) Login to your hosting server and get inside your sql database.(If you are using AWS check this post on how to login.)
mysql -u root -p
2) Select the wordpress database
mysql> USE wordpress;
3) Delete the posts with type “revision”. This command will delete all revisions of all your posts leaving only the latest version.
DELETE from wp_posts WHERE post_type = “revision”;
You can run this DELETE query in your phpmyadmin console also.
4) If you are not comfortable with command line or coding . You can simply install a plugin called “Simple Revisions Delete” in your wordpress dashboard. It will provide you “Purge” option in each of your post to purge old revisions.
Caution:- Before you decide to delete revisions, it’s better to take backup of DB and be absolutely sure that you want to do this. As the only way to get them back after deletion will be to restore them from backup.