Easy way to Track Post Views Count without Plugins

Its always important to track the performance of any post or page and that can be easily done by tracking post views . Post views can be defined as the total number of views of a particular/single post get after its publication. There are some plugins that help to track pageviews but in this post I will share you method to track pageviews without any external plugins that help your website increasing website speed.

On WordPress website, we can track and display the all Post View Counter by doing the following steps:

Steps 1:Login to WordPress and go to Appearance>Theme Editor>>Function.php

After opening function.php file and copy the below code and paste

function getPostViews($postID){
$count_key = ‘post_views_count’;
$count = get_post_meta($postID, $count_key, true);
if($count==”){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, ‘0’);
return “0 View”;
}
return $count.’ Views’;
}
function setPostViews($postID) {
$count_key = ‘post_views_count’;
$count = get_post_meta($postID, $count_key, true);
if($count==”){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, ‘0’);
}else{
$count++;
update_post_meta($postID, $count_key, $count);
}
}
// Remove issues with prefetching adding extra views
remove_action( ‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0);

Steps 2: Set post views using single.php 

Following same path Appearance>Theme Editor>>single.php ,copy the single line code and paste on the file and save.

postviews-in-wordpress

setPostViews(get_the_ID());

Steps 3: Last now copy the following below code and paste where you want to show the pageviews

echo getPostViews(get_the_ID());

The above-mentioned methods shows a total number of views and user frequently visit the same post it will counts. So to get the unique number of views please proceed further:

You can collect unique visits by setting cookies and the IP address of visitor is trace and avoid the increase the page views when same user visits the given page . Please add the following code :

 

function setPostViews($postID) {
$count_key = ‘post_views_count’;
$count = get_post_meta($postID, $count_key, true);
if($count==”){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, ‘0’);
}else{/*
* Check the cookie is exist or not.
* If not the set cookie for some time interval and
* increase the count
*/
if(!isset($_COOKIE[‘wpai_visited_ip’]))$count++;
update_post_meta($postID, $count_key, $count);// Get IP address
$visit_ip_addr = $_SERVER[‘REMOTE_ADDR’];
// Set the cookie
setcookie(‘wpai_visited_ip’, $visit_ip_addr, time()+ (60 * 1));

}
}

Disable block editor in WordPress ( Explained)

Block Editor:

WordPress introduces Gutenberg (block editor) on 2018 A.D with version update of WordPress as 5.0 that creates a huge impact on users regarding its usability. Most of the blogger found difficult to use Gutenberg and prefer Classic Editor instead Gutenberg.

People find it hard to accept Gutenberg updates when they don’t see why it’s necessary to change something that was working fine and users were used to the classic editor because most of us found it as simple and easy to use.

 

block editor

In this blog we will learn about switching to the classic editor in two simple ways that may not take more than 5 minutes for its implementation.

  • Installing Classic Editor

This is the easiest way to revert back to the classic editor and to install classic editor you should follow the following steps:

  1. Go to plugins section on WordPress admin dashboard
  2. Click on add new plugin
  3. Search for classic editor
  4. Install and activate the plugin

plugin-install

classic-editor
Now you are done .

If you don’t like to install worpress plugin then  you can also disable block editor using code ,here I have given full steps for disabling block editor using function.php file .

  • Disable Block Editor

To disable the block editor , you need to open theme editor ( Admin Dashboard > Appearance > Theme Editor ) and copy the below code .

#New Edit For Disable
add_filter( ‘use_block_editor_for_post’, ‘__return_false’ );

editor-in-wordpress

After  opening the theme editor select function.php file and paste the above code into that file and update the function.php file and you successfully disabled the block editor.

 

 

 

Best way to select web hosting in 2020

How to select the best web hosting company in 2020?

web hosting
If you are planning to start your blogging journey in 2020 then this article will guide you to select the fundamentals requirement of web hosting, latency checking, optimizing general website performance.
Most of the beginner faces the problem on choosing the right hosting company within their budgets.You might be surprised to hear that the majority of web hosting companies are owned by just three large corporations – GoDaddy, Endurance International and 1and1.

 

Among the three main giant hosting company there are many hosting companies that are providing their own services apart from the internal server sharing. Do not worry, they don’t sell your information to a parental company they are only owned by a single entity. When you scratch beneath the surface, you’ll find dozens of the “top” hosts are ultimately owned by these three corporates. A lack of competition means prices have been kept high (and rising), whilst client apathy to migrating means service is often lackluster, as you are just a client number out of millions.
Funny things are that you might find some company price so cheap and after buying the services you will force to upgrade the plans to higher specifications.

Most of the beginners are lured by their upsell strategies and that makes hosting experience bitter. So i will make your choosing web hosting company task a little easy. Domain registration can simple task because it don’t need much investigation about provider but a selection of web hosting among thousand providers is certainly a difficult task and i will help you to find criteria of choosing best web hosting company.

While choosing any hosting plans one should cross-check the following requirements:

Reviews:

you should cross-check reviews of the company on reviews sites like Trustpilot , Hostadvice, Google Listing and many more.A company who has maximum good customer reviews is base of selection because reviews reflect the company’s customer satisfaction. A company may have a different class of services and this cannot be the only core aspect to judge fully but the company overall support can be easily predicted.

Control Panel:

This is also one of the key factors for selection for beginners. Most of the beginners don’t have good knowledge about the control panel. For the management of the core systems, you need control panel like Cpanel, Directadmin, Plesk, etc and Cpanel is leading web control panel and most used panel till to date . If you have basic knowledge about web hosting then you can set up a general task like creating a custom email for your site ( [email protected]) and file manager etc.

Backup:

Web hosting is dynamic in nature and anyone can face fatal errors like losing website content. But this can be greatly reduced by backup services and peace of mind can be entertained only if the website has backup services. So even you lose the content you can restore it from backup available.

SSL certificates:

Secure Sockets Layer (SSL) is a networking protocol designed for securing connections between web clients and web servers over an insecure network, such as the internet. The most popular web search engine, Google takes it on most priority and gives a red alert when SSL is not found on site.

Softaculous:

If you want to start a blog then this can play a vital role and Softaculous is web applications that have collection of 200+ scripts like WordPress, Joomla, Magento, social networking sites, Forums. The most demanded features is that it has one-click installation features that give users to install the required CMS in just a single click.
Support: Web host provider should provide support 24×7 and most of the web hosting company provider claimed but fob you off when you need help with their hosting package.They may use complex jargon to explain simple things so be smart to choose a web hosting company.
The above mention things are general features that most be available to make hosting great. Some of the things that people cannot checks before using are mention below and you must ask your hosting company if they fail to give minimum features mention below :

Uptime :

Most of the web hosting companies claimed they have 100% server uptime time but that may be different after using their server. They must have at least 99% uptime that ensures your website gives full accessibility to users at any time. Your website should be online for visitors and google crawlers so that google will boost the ranking.
Server Performance: Your website is hosting on a shared server in almost every web hosting company. The shared server reduces the operation cost of the server and so that web hosting costs you a penny . While using the shared server one should confirm the sharing ratio and now most of the web hosting company uses cloudlinux that gives the power to assign resources to individual account so that you are not affected due to other users using the same server. While using shared hosting you should monitor the performance and backend server configuration setup that originally set up by web hosting and report if you find resources limit. Latest technology like Litespeed cache system enhances the server performance and event-driven architecture, capable of handling thousands of concurrent clients with minimal memory consumption and CPU usage.

Cloud Server:

You also ask your provider about the server -a cloud server or a traditional server because cloud server are more expandable and stable in comparison to traditional servers.The load balancer server distributes the traffic among various datacenters so if they have load balancer server then it would be adding the performance of your website.

Lastly ,the above mentions things are enough for selection of good web hosting company for you .

Best way to start blog in 2020

Starting blog is a great decision that you have made and I know it is a hard time for a beginner blogger to start a blog without guideline and advisor so in this blog section I will guide you to be a professional blogger by starting a blog from scratch. All you need to have patience and you must go through.

As i discussed in my first post that how you can earn through affiliated marketing, today i will discuss how you can earn simply through blogging. Earning from Blogging is not cup of tea ,you need passion and hard work. You must have a research mind so that your content will be viable to the latest market. For example, If you write about NOKIA 1600 none of the people search about it and you cannot derive traffic to your site and people are not interested to know about the configuration of the Nokia 1600 model. Today’s market is viable to android users and most of the people are interest on it.so choose niche of blog according to market demand so that you can derive traffic from posts.You should be clever regarding Niche of your blog ,most easy way to select Niche of blog is your key of interest.If you are interested on mobile gadgets or technology related stuff then start Tech blog, on which you can write reviews about gadgets,tech etc.

After selection of Niche of your blog,now you need to choose good platform to start you blog. To start a blog you should have a personal hosting such as bluehost, it is a very simple and innovating and easy to manage your blog easier, especially WordPress Blog and bluehost is one of the dedicated Hosting platform for wordpress,I suggest to use bluehost for your website and blog.
But if you want completely free blog then you can use Blogger which is completely free by google but all you need is custom domain.For custom domain like www.yourname.com,you need to buy from registar which probably cost you 12$ normally or you can register free .np domain(link) ccTLD .But if you want to become professional blogger then go with wordpress because wordpress is easy to manage and there are alots of tools and plugins available for SEO .But if you are beginner and donot want to take risk then you can choose blogger which is free and secured.Blogger is free platform for blog around the world and it is hosted by google.Since it owned by google here you can enjoy alots free services like SSL and your blog is totally protected.Earning from Blogging dream will come true if you have passion besides the good platform.

 

It is the most important phase where Earning from Blogging will come true.In this phase you should launch website or blog which must be user friendly.After launching blogs all you need is good content and search engine optimization(SEO).Earning from Blogging is not that hard,all you need is consistency and little analysis.If you are newbie then at begining, you may not know what visitors want to read in your blog but after few posts you can easily analyse which posts are getting good hits and response.To make your task easier there are many tools available. Google Search Engine Console (link) ,Search Engine Console for Bing and Baidu*(link) ,Keyword research tools(link),etc which can reduce burden and you can easily rank your post in search engine(link).
Earning from Blogging is possible when you have adsense account or its aternatives or affiliate marketing.For Adsense account your blog should enough content and has good visitors.Earning from adsense depends upon the Niche of your blog.For example ; your blog is about insurance and google has many advertiser then you can get good CPC(cost per click) and can earn good revenue.But if your blog is about lifestyle and photography and google has not enough advertiser related to your blog niche and your country location then cpc is low and you cannot maximize revenue.You can earn from affiliate marketing which i am discussed in my earlier blog.You can check the post from here.You can earn from local brand by promoting the brands in your blogs but to get such advertisment your blog should be popular enough and has a good alexa ranking(link).
At last i wish your Earning from Blogging jouney will be longer in your life and you will generate good revenue from blog.I present you my earning from adsense which i have generated from this blog.My earning is not high because i cannot give my full time on blogging as i am engineering student and web developer.