PurabTech is technical blog for Programmer and Coders
Author: Purab
I am Purab from India, Software development is my profession and teaching is my passion.
Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks.
Purab's Github Repo
Youtube Chanel Video Tutorials
Connect to on LinkedIn
For interlinking articles in wordpress, we need to install and configure SEO smart links in wordpress. Here we given steps and screenshot with their details. In following article we already written, why interlinking is important in any website.
how to configure SEO smart links in wordpress website
SEO Smart Links (https://wordpress.org/plugins/seo-automatic-links/)
how to configure SEO smart links in wordpress website
SEO Smart Links provides automatic SEO benefits for your site in addition to custom keyword lists, nofollow and much more.
SEO Smart Links provides automatic SEO benefits for your site in addition to custom keyword lists, nofollow and much more.
SEO Smart Links can automatically link keywords and phrases in your posts and comments with corresponding posts, pages, categories and tags on your blog.
Further SEO Smart links allows you to set up your own keywords and set of matching URLs. Finally SEO Smart links allows you to set nofollow attribute and open links in new window.
It is a perfect solution to get your blog posts interlinked or add affiliate links to other sites.
Everything happens completely transparent, and you can edit the options from the administration settings panel.
configure SEO smart links in wordpress
We have given the screen shot of each and every step. Using above screenshot, configure “Internal Links” section. Please Use setting as per shown in image.
Settings section
Using above screenshot, configure “Setting” section. Please Use setting as per shown in image.
Limits section
Using above screenshot, configure “Limits” section. Please Use setting as per shown in image.
Here is Video tutorial for configure SEO smart links in wordpress
SEO Smart Links – Premium Edition
SEO Smart Links is a very powerful plugin which suits both beginner users (with a plugin&play philosophy with optimal options pre-set) as well as those proficient in the art of SEO with numerous customizable features.
SEO Smart Links – Premium Edition enhances your search engine rankings by automatically inter-linking your posts either in automatic or in user-set mode. It also helps you manage your affiliate links and much more. Click to read the full list of features and buy here.
Our Review:
SEO smart link is really smart in terms of behaviour in wordpress webpages. It is quite fast as compared to other wordpress plugins which has used for interlinking. We experienced good amount of traffic increase and page view increases. The important part, It decreases the bounce rate.
Many times we receive unwanted spam comments email notification from wordpress website. We personally faced comments email notification issue so many times. Many of our clients also faced this issue. WordPress itself given facility to turn off wordpress comment email notification using wordpress admin section. WordPress by default enable the all email types of notification on.
turn off wordpress comment email notification
In this article, We will show you, how to turn off wordpress comment email notification. Using wordpress administration you can switch off wordpress comments email.
Login to WordPress site dashboard. In left side menus, go to Settings » Discussion. Then look at where it says “Email me whenever” and “Before comments appear” un-check the boxes there.
turn off wordpress comment email notification
Please Use setting as we shown in above picture and save the settings. After this your email notification will be off. Using Other setting “Comments author must have a previously approved comment”. Uncheck that checkbox also. So previous commenter will never publish there comments without your approval.
Why turning off wordpress comment email notification is good?
WordPress send email notification through your server. Many times from sendmail server. If you are getting the huge amount of spam comments than, Your server will try to send email for every spam comment. It will use huge amount memory and server CPU. In that can first stop comment email notification.
Additional Comments setting
On Discussion Page we have “Comment Moderation” section. This setting about spam comments. In textbox you need to add words which you think could be spam related wrods than you can put those words there.
When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the moderation queue. One word or IP per line. It will match inside words, so “press” will match “WordPress”.
You should add some spam comments related words. We will write about “Comments Moderation” in next coming days.
Earlier we also used disqus comment system. But now we stopped using disqus. Disqus comment system is most powerful and popular third-party comments tool. this tool is really great. With disqus you don’t need to worry about spam comments. Some times we faced slowness with disqus comments system so we stopped using disqus comments system.
If you want to use disqus comment system then go to following URL and download from here
Disqus, pronounced “discuss”, is a service and tool for web comments and discussions. Disqus makes commenting easier and more interactive, while connecting websites and commenters across a thriving discussion community. The Disqus for WordPress plugin seamlessly integrates using the Disqus API and by syncing with WordPress comments.
how to disable disqus for custom post types in wordpress
If you are creating premium theme. Or you are trying to create the wordpress theme for your client than you need to control everything through your theme control panel. Using following code you can easily control disqus comment system through your wordpress theme code.
how to disable disqus for custom post types in wordpress
We given step for disable disqus for custom post types in wordPress with code.
What you need is, just copy and paste following code in functions.php file (wordpress theme). Use following code.
add_filter( 'comments_template' , 'wpb_block_disqus', 1 );
function wpb_block_disqus($file) {
if ( 'custom_post_type_name' == get_post_type() )
remove_filter('comments_template', 'dsq_comments_template');
return $file;
}
Note: do not forget to change the “custom_post_type_name” name as per your custom post name.
Above code will check for custom post type and if current post with given custom post name than disqus comments will be disabled. This is safe way to disable disqus comments for custom posts.
You can use the Appearance ->Editor option also. Open functions.php file in Editor and at end of file Just put above code.
Following are some Useful article related to wordpress comments:
There are many caching solution available in open source. But Varnish is best in among. In this article, We given full steps to use and install varnish with wordpress and apache server . varnish setup with your wordpress site. Many website webmasters installed Varnish on their production servers to handle millions of requests without delay in response. There are many caching plugin like W3 Total Cache, WP Super Cache, Hyper Cache and so many..
Varnish is free open source software licensed under a two-clause BSD licence aimed to really super boost server performance. In short, it will work as web accelerator between any server that speaks with HTTP (Apache or any other).
how to install varnish with wordpress and apache
Why Apache or Nginx is Enough to Handle Huge Traffic
Many system administrator do many tricks with Apache because it performs really bad when the server is getting very high requests. Some people started using other servers like Ngnix and LiteSpeed. WordPress itself are using Ngnix server for many years for production environment. But still performance and response time of website is not that much fast with these plugins. So Best solution is Varnich Cache.
Varnish Explained Here
Vanish server started working on top of Apache server. When HTTP request comes to server first it will go the varnish server, If Vanish server has the response in memory cache then it will give response immediately, If Varnish server does not has cache for that request then it will go to apache server and get the response and keep in cache. Next request will delivered by Varinish cache, which will be so fast. Using varnish cache you can increase your server performance and response time by 300 to 900x. I personally checked response time difference. Before installing varnish cache my server response time was 3.46 second. After installing Varnish Cache, my server response time was 0.3, Means My server response increased by 1000x.
In following diagram, we explained, how varnish server process request.
varnish processing request compressed, how to install varnish with wordpress and apache
Why install varnish with wordpress
It will reduce server load , by reducing CPU work
It will load your load your WordPress website very fast, because vanish cache stored in RAM.
Your wordpress site SEO will increase, Because your site will load so fast
Response time will reduce by 1000x
Google page speed response score improves by at-least 20%
how to install varnish with wordpress and apache
Note: You can use this tutorial for setup varnish with any apache website. If you used HTML, ROR, JAVA, PHP for your website than you can set up varinish as we shown in this article. Here, we are assuming you already installed wordpress with apache server on linux server.
We are using dedicated Linux (centos) server for hosting our sites. So here we given steps can be applicable for Red Hat, Centos, Fedora, ubuntu server. But for ubuntu server you need use “apt-get install” instead of yum install.
So now Just follow my steps to install the varnish server. For latest version of Linux, you don’t need to install repository. But for older linux version you need to install the Varnish server repository. For that use following command to install varnish repository.
Than you will be ready for install varnish server. Use following command for installing varnish server. You need to run following command as root. So first became root.
yum install varnish
Configure Varnish to work on port 80
usually Apache run on port 80 and your all sites will run on port 80. So as I told you earlier in this article. (check Varnish Explained section) Varnish work on top of apache server So you need to set up varnish on port 80. In CentOS, RedHat, Fedora, and Ubuntu server, Varnish configuration file located in “/etc/sysconfig/varnish”. You can edit file using vim or vi editor or you can download file to your PC and edit it then upload to server.
I am using vim here.
vim /etc/sysconfig/varnish
Please change files first part code as per I shown in image. OR you can download setting file from here:
[viral-lock message=”Download Link is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]
Got to “Alternative 2” section and change setting as I shown in image. Un-comment all the lines after “Alternative 2” as I shown.
By default -s setting will be pointed to filesystem, change that to memory. This is important, because we want, varnish give response from memory.
you need to change “-a : 6081 \” to “-a : 80 \” as we shown here in image. You can change “256m” to higher number, which is depends on your server configuration. If you have higher memory server then you can 512mb or 1GB for Varnish server. Many websites are using 4gb for varinsh servers. But they have a huge amount of traffic.
varnish configuration, install varnish with wordpress and apache
Second Part of configuration – go to end of file, using “shit+g” key. Change configuration as per I shown.
Got to “Alternative 3” section and change setting as I shown in image. Comment all the lines after “Alternative 3”
varnish default config , install varnish with wordpress and apache
Change server config of Varnish
Like Apache server, Varnish server VCL file found in “/etc/varnish/default.vcl” location. Varnish VCL file is configuration for looking for apache(server) response data(content). You can edit this file using vim editor as per shown in following image OR you can download file from following location.
[viral-lock message=”Download Link is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]
varnish server config, install varnish with wordpress and apache
Change the port 80 to 8080 port as We shown in image. Means Varnish server will generate cache from port 8080 so you need configure your apache server on port 8080.
Now Varnish configuration is complete. Now we need to configure apache server to send apache in back of varnish server.
You need to change following setting of your apache server. By default apache config file is htttpd.conf or apache.conf file. You will find this file in “/etc/httpd/conf/httpd.conf” location. For ubuntu that will be other location. Open your apache config file.
You can download apache configuration file from here. You can refer only “custom.conf” file. it has all changed configuration.
We created custom.conf file and added under “/etc/httpd/conf.d/” folder. So that file will be automatically loaded in apache config.
You can add following code in your apache configuration file as we shown in following image. You need to change the NameVirtualHost 80 to 8080. So your apache server will run on port 8080.
apache server config with varnish, install varnish with wordpress and apache
You need to change VirtualHost entries for each of your domain. This is very important, If you do not change this properly then your apache server will through error while restarting.
Now your Varnish and Apache configuration are done. So time to restart both servers.
First Stop the Apache server and start the Varnish server. After starting Varnish server. Again start the apache server. You can use following commands step by step. Use commands in following order.
service httpd stop
service varnish start
service httpd start
Note: If you try to start varnish server without stopping apache server then it will never start because it will try to start using port 80.
Test Website performance and response time
How can you test your site pages speed and response time. Go to following “Google pagespeed” URL to test the website response time.
Check Varnish service is running for your site. go to following URL and add your website URL in inputbox and select “service scan” checkbox and click on go button.
You will get response as shown in following image.
As per explained in this article. After varnish configuration, your website will perform much faster then earlier and server CPU will not be consumed by apache server. We are using small dedicated server so we used only 256mb memory. If you have 1gb RAM of our server then use 256mb means one-fourth of memory for varnish server. When you have all code and database of same server.
Varnish Useful commands
# varnishlog : Provides detailed information on requests.
# varnishtop : It reads varnishd shared memory logs and presents a most commonly occurring log entries.
# varnishadm : Command-line varnish administration used to reload vcl and purge urls.
# varnishstat : Provides all the info you need to spot cache misses and errors.
# varnishhist : Provides a histogram view of cache hits/misses.
By “varnishstat” command you can check real-time statistics of varnish server. You can see following items
Client connection
Hit rate ration
Hit rate average
Number of client connections accepted
Following is screenshot of my production site. There are a lot of useful data provided by varnish stats
varnish varnishstat, install varnish with wordpress and apache
Create Varnish Log File
Using following command you can create varnish request log file as per apache log file. In this file you will get similar information like apache access log.
varnishncsa -c -a -d -w /var/log/varnish/varnish.log
For more varnish commands you can go to varnish site using following URL.
Now you are set with varnish server and wordpress site. Above article can be used for any linux distribution like, Fedora, Ubuntu, Centos, RedHat and Suse. Commands will be same and configuration will be same.
In wordpress configuration you do not need to change anything. With Varnish server .htaccess file will not break because still main webserver is apache.
If you still need assistance to install Varnish server and configure production server then contact to me.
Google analytics became primary requirement of every websites. Google analytics provides every aspect of data with all type of user behavior and information. Where from user came to your site. How much time user spends on user website. which pages are most popular in your website.
Similarly wordpress is widely used for creating websites. So here in this article I will show you how to add google analytics in wordpress footer.
how to add google analytics to wordpress footer
Need google analytics account
First you need the google analytics account, If you don’t have than, Go to the Google Analytics site and create a new account. There are many sites or check for YouTube video for getting the google analytics code from site.
Add Google Analytics script to Your WordPress Theme
Login to wordpress admin panel, Then goto “Appearance->editor” section. Then open footer.php file in editor. Before “” close tag put your google analytices code there. After adding analytics code save the file.
how to add google analytics to wordpress footer
This is easiest step to add the google analytics to your wordpress theme.
There are many plugins which will give you facility to add google analytics to your wordpress site. Here we recommend you to use following wordpress plugin for adding the google analytics.
Email subscription marketing is very becoming vary famous these days. There are many companies are focused on only email subscription and email campaigning. Email campaigning is key focus point for many huge companies. Same with small firms and companies.
In this article I will show how to add free add feedburner subscribe popup to wordpress.
add feedburner subscribe popup to wordpress
Similarly wordpress is used by many big and small scale companies. Some blogger are also looking for free solution for email subscription. Using email subscription you can increase you site visitors so drastically.
Google feedburner is absolutely free email subscription server provided by Google itself. I found very useful free wordpess plugin which allow you to add popup in your wordpress website and force visitor to subscribe email with your website.
This plugin is very useful to you when you are running the corporate site or blog.
jQuery Popup Feedburner Subscriber Form appears on Page Load.
You can 1. Enable/disable jQuery Popup Subscriber Form from admin panel 2. You can set the feedburner feed id from admin panel 3. You can change the Heading and Detail from Popup form from admin panel
Admin panel of Feedburner plugin
Feedburner Pop in Action
add feedburner subscribe popup to wordpress
We personally used this plugin for your sites. If you have knowledge of UI development then you can easily customize UI and look and feel of popup. Feedburner is free email subscription service so you don’t need to worry.
Every wordpress theme has different thumbnail sizes. By default wordpress create multiple resized images. By default wordpress create four resized images. Means when we upload image, wordpress upload five images on server. Which is not necessary and unwanted. If your theme added, custom thumbnail sizes then it create more than five images and upload on server.
Why regenerate thumbnails in wordpress is important
Due to custom thumbnail sizes your server images data will always increase. So Whenever you use new wordpress theme, regenerate thumbnails in wordpress as per your theme UI. After changing wordpress theme. sometimes you don’t found old images for using as featured image or thumbnail. Because in new theme, default thumbnail size would be overridden through code. So regenerating thumbnail images is always important whenever you change the wordpress theme.
how regenerate thumbnails in wordpress
I found nice wordpress plugin which will delete unnecessary images from server and regenerate thumbnail images as per your theme requirement and design. This plugin will delete unwanted images from server or your site and save your disk space. This plugin is very great when you are using shared hosting or small server.
regenerate thumbnails in wordpress. Delete and REALLY force the regenerate thumbnail.
Force Regenerate Thumbnails allows you to delete all old images size and REALLY regenerate the thumbnails for your image attachments.
I personally used force regenerate thumbnail plugin. Earlier on my server there are more than 4 thousand images were uploaded but I found more than 25 thousand images on server (in uploads folder). After using regenerating images there are only 12 thousand images were created by this plugin. I really found useful this plugin. it saved my disk space and deleted the unwanted images.
regenerate thumbnails in wordpress
There are other plugins which regenerate the thumbnail but they never delete the unwanted images from server. Only bad thing about this plugin is, It does not optimize images with regeneration of plugin. I will write about optimizing uploaded images in next article.
We used many social sharing buttons for wordpress. All plugins found similar, At the we started looking for social sharing buttons for wordpress without javascript.
we written review of many social button wordpess plugins review. You can find wordpress plugin review in our blog. Every social button plugin load bunch of javascript files to your site. It causes huge amount slowness of site and SEO impact. So We recommend you to not use such social button wordpress plugin which will impact site loading.
social sharing buttons for wordpress without javascript
We found really nice plugin. we tested this plugin for our some blogs and site. Lessbuttons wordpress plugin not load the javascript to your site which cause, slow site loading. Here is lessbuttons wordpress plugins information. It is mobile site friendly so you do not need to worry about responsiveness.
Admin Panel of Lessbuttons wordpress social sharing plugin
Admin Panel of Less buttons wordpress social sharing plugin, social sharing buttons for wordpress without javascript
LessButtons automatically display sharing buttons for those social networks, where visitor registered and logged in.
Support automated detection and display buttons for Facebook, Twitter, Google+, Pinterest, LinkedIn, Reddit, VKontakte, Odnoklassniki. 100+ more social networks and bookmark services available to users.
Features
Buttons for those social networks, where visitor registered.
Dynamically updatable share counters on all buttons.
High-resolution icons for retina displays.
Fully customizable appearance.
HTTPS protocol for secure communication.
Tracking social network detections and shares in Google Analytics.
Email sharing via Gmail, Yahoo! Mail, Outlook.com (Hotmail), AOL mail or standalone apps.
Statistics
If you have Google Analytics tracking code on pages, it will automatically receive tracking notifications for each visitor registered in social network or share button pressed. It give you know what social media is popular with your visitors.
Find Shares
Magnifier sign on Twitter, Google+ and VK buttons allows your users to find more peoples who share your page.
Custom Placements
Before content, after content.
Left and right side floating share bars.
Horizontal floating share bar on bottom of window.
Special place option for mobile devices.
Optimized
Asynchronous script will not slow or block your website pages from loading.
SVG icons for quick loading and better appearance.
We use global world-wide CDN for fastest content delivery to each visitor location.
Mobile devices detection and compatibility.
Here is preview of Social buttons on my site. You can see demo of social buttons on my blog itself. (https://purabtech.in)
social sharing buttons for wordpress without javascript
In wordpress image gallery, it uses the full image size by default for every gallery but you can select or set the another image size. Using following code you can set the default image size for your wordpress image gallery.
Select default image size for gallery in wordpress
just copy and paste following code to your functions.php file:
Many times you do not need the many image sizes for wordpress. You need the original image only for your wordpress sites. Sometime you need the original and thumbanil image only. But many wordpress themes creates the multiple image version in your site which is not useful. Using following code you can remove the unwanted images while uploading the images.
Here in this article I going to show you, how we can remove unwanted image sizes from wordpress theme. Using code snippet, you can easily remove unwanted image sizes.
remove unwanted image sizes
You just need to add following code into functions.php file.