WordPress tags are very important. For SEO we use tags. Here in this article we will show post tags in drop down box using simple php script.
Little Background about creating tag drop down
For one of my wordpress plugin, I want to show tags drop down in widget setting form. I created plugin called “Smart Posts Widget“. For this wordpress plugin, I created tag drop down.
In wordpress get all tags in drop down terms
I used following code for creating drop down. If you want to create wordpress post tag drop down for some setting or configuration use following simple code.
Here in this article We will show, How to create template using easy steps. We written many wordpress tutorials about creating many types of custom templates. For custom pages always we need new look and feel. Some time we need separate functionality for specific pages.
Following are list of template wordpress tutorials which might be useful for you.
Creating custom page template is very easy, For creating custom template you need to create php file in your wordpress theme folder.
How to create template
You need to create new php file in wrodpress theme folder. Go to your theme’s folder (wp-content/themes/your-theme).
Create a New PHP File
Always create custom template with extension -page.php . Here I am giving example of creating contact us page. So we will create page called “contact-us-page.php”.
Add Following Code
Use following code and just copy paste following code in contact-us-page.php file
So, your Custom Page Template is now built, but you will still need to choose it whenever you want to use it. You do that by going to the right-hand side of the screen whenever you’re writing a Page. You should see a section there that says, “Templates” with a pull-down menu.
how to create contact us page without wordpress plugin
If you need full code of contact us page than check following URL:
Using above easy code you can create custom page template in any wordpress theme. You can create custom styling for template page which will be applicable for only selected pages.
WordPress Spam comments is big issue. I am getting daily 5k spam comments daily. we automated task of deleting spam comments automatically. Daily going to comments dashboard and deleting spam comments is really boring task. WordPress Akismat wordpress plugin does good job of finding spam comments.
automatically delete spam comments in wordpress
How to automatically delete spam comments in wordpress?
I am using Akismat wordpress plugin for my all wordpress blogs. It does good job of finding spam comments. Due to spam comments. comment-meta table becoming big and causing mysql resource issues. So cleaning comments table became necessary. so we used following hook in wordpress theme code.
Notes:
The number of blogs is hardcoded (3000)
Add above code in functions.php file.
If you want WordPress to automatically empty my spam comments after 1 day. Just add this to wp-config.php. Following code will automatically Empty Your WordPress Trash
We have many guest authors who writes in our blogs. So creating author page is good idea. Here in this article we created author page template in wordpress theme. There are many wordpress plugins available which will give you facility to show author list.
Without wordpress plugin show author list
Here we created simple wordpress page template for showing author list in wordpress website. we created authorlist.php file in wordpress theme folder and added following code in that file.
add above code in functions.php file. You can change styling as per your website code.
create author page template in wordpress theme
Now login to wordpress admin panel and go to pages. Create new page called “Author List”. From Page Attributes section you need to select Template.
create author page template in wordpress theme
As per shown in above Image. You need select “AuthorList” in Template DropDown and save the page. Than add Authorlist page add in menu. Now you are able to see the Authorlist without extra wordpress plugin.
wordpress seo tips, Here in this article, we shown how to add nofollow and _blank target to wordpress author bio (Biographical Info) section. I am writing blog since 2008. I written on many topics and many blogs. I always accept article from guest author. Some of guest author want to publish their company or personal information in author bio section.
Some months before google changed search engine algorithm. Google look in blog, how many direct out links are used in site. I have many author articles and bio section published in our blogs. We decided to add Nofollow and new tab link attribute in for author bio section.
add nofollow and _blank target to wordpress author bio
If you manually try to add blank target and nofollow for anchor tag. wordpress removes nofollow and target from author bio section using hook.
add nofollow and _blank target to wordpress author bio
We used simple str_replace method to modify the author bio section.
We created post-author.php file and added following code in that file.
WordPress has functionality of create custom post type. By default wordpress shows “Enter Title Here” for every post type. Basically every content type is custom post in wordpress. When you create new post you will able to see this placeholder text.
For custom post type we need to add Change ‘Enter Title Here’ Text for custom wordpress post. Many times we create custom post type for custom projects. Here in this article we shown you, how to create custom post type and change placeholder text.
When we want to customize custom post
If we are creating product custom type and want to add product description and their photos. For that you cannot use ‘Enter Title Here’ text. You need to give information to admin users with clear directions. So many times with custom post type you need to change placeholder text.
Using Following code You can create custom Post type
You need open functions.php file from your theme files and put following code.
return__( 'Enter Product Name here', 'your_textdomain');
08
09
return$input;
10
}
Change ‘Enter Title Here’ Text for custom wordpress post
Changed Placeholder text will look like as above shown in image. It is very simple and short code. You can change above code as per your project requirement.
In wordpress widget or on homepage, In wordpress get random posts from category. Here in wordpress tutorial we have given some nice tricks and tips for wordpress developers. There are many ways to achieve this. I can recommend to use Page Builder Plugin and use smart posts widget plugin.
wordpress get random posts from category
Above plugin will not add any database table to your wordpress website. We prefer to use the above plugin. Using smart posts widget plugin, you can show random post with simple setting or configuration.
Still you want to show random post by using code than use following code.
Smart Posts Widget – is designed to show your posts as you want without any programming knowledge. display all type of post types from a certain post type or post category or post tags.
There are many options for user to filter or order posts. You can able to select many options to choose your posts.
Smart Posts Widgets developed to provide very easy to user for displaying all types of posts within your widget areas.
widget is compatible with Page Builder. You can create beautiful page layouts and show posts as per your choice.
Webmaster verification is process which will enables some site management tools by provided by google, Bing and Yandex. Here we given full steps for Google, Bing Verify ownership with wordpress website.
Why website verification is important?
Site Verification will not increase your page rank or search results of your website, It will help you to optimize your website with SEO tools.
Verify your website
If you have custom sitemap XML then you should open webmaster account and tell search engine about your sitemap file. If you have sitemap.xml file in webroot still we recommend to submit your sitemap file to search engine.
Google, Bing Verify ownership with wordpress Website
Manual Process for Verify ownership with wordpress website
Google
Login to your Google Webmaster Account (if your website has Google Analytics, Google Adsense or Google Search, you can use the same Google account). If you don’t have one, you can create one for free on www.google.com/accounts.
On Google Webmaster Tools click ‘Verify this site’.
In the Verification method list, select ‘Meta tag’ and copy the part of the Meta tag code provided by Google that is inside content=”…”.
Google+ (the social network)
Make sure you have a link from your Google+ Page to your website. Easiest place to do this is in the “Recommended Links” section of your Google+ Page’s “About” tab.
Paste your Goggle+ Page ID number, which is part of the URL for your Page. For example, the URL for YWDs’s Page is https://plus.google.com/u/0/purabkharat/posts so our ID number is purabkharat.
In ‘Option 2 (Meta Tag Authentication)’ select copy the part of the Meta tag code provided by Bing that is inside content=”…”.
Pinterest
Go to your Pinterest page select “Settings”.
Scroll down to “Website”. Enter your website URL iinto the filed. Click the “Verify Website” button.
Click the link “Verify with a meta tag”. Copy the part of the Meta tag code provided by Pinterest that is inside content=”…”.
Automated Process for Verify ownership with wordpress website
Seo Meta Tags (https://wordpress.org/plugins/seo-meta-tags/)
This wordpress plugin gives facility to add Google, Bing Verify ownership with wordpress using WebMaster tool and meta tag added Social AuthorShip meta Tags added for Facebook, Twitter. You do not need to install too many plugin for wordpress SEO. You can just install SEO Meta tags plugin. It will handle all SEO aspects of your wordpress website.
Google, Bing Verify ownership with wordpress
First install SEO Meta Tags wordpress plugin. On right side menu you will find “Webmaster Tools” page. Add your meta tags here. It will add best of meta tags to you wordpress site. This plugin will add best of SEO meta tags to your wordpress website. It will boost your wordpress website SEO in two weeks.
Page bounce rate is many time discussed in many article. Here we shown, how to reduce bounce rate google analytics in wordpress. Showed tricks for reduce bounce rate. My site was having high bounce rate always. I tried many tricks for solving the issue. Then I read many article about bounce rate. how google analytics calculating bounce rate.
I was recently told that some people use event tracking to find a truer bounce rate. Yes. You can reduce bounce rate by using some adding some javascript event to wordpress site. I found nice wordpress plugin which will help us to reduce bounce rate.
how to reduce bounce rate google analytics in wordpress
how to reduce bounce rate google analytics in wordpress
Get the real Time On Site and Bounce Rate in Google Analytics. Google Analytics calculates the Time On Site based on the length of time between a user entering your site and their last page view. This won\’t give you the REAL Time on Site and Bounce Rate stats.
FEATURES
Old and new tracking codes are supported
Code placement choice between header and footer
Track page scrolls
Change time event frequency
Set maximum tracking time
Disable for administrator role
Worst case scenario A visitor is very interested in one of your pages and takes 2 minutes and 13 seconds to read the article. After this he bookmarks the page and leaves. This visitor stayed 2 minutes and 13 seconds on your page, but never interacted with it. To Google that is a bounce! And bounced visits are marked 0:00 Time on Site. Not fair, right?
Another bad scenario A visitor goes to your website and stays 1 minute and 11 seconds on the first page. Then, he goes to a second page where he stays 1 minute and 12 seconds. Without any interaction on this page, he leaves. Since Google doesn’t know how long your visitor stayed on the second page, Google will add only the time the visitor spent on the first page to Analytics. Not fair, right?
We installed this plugin and we found really good impact. Our websites bounce rate started reducing. It takes one or two weeks to see impact on google analytics page. Here In this article, we given screen shot of our google analytics page.
As a SEO specialist, We know the importance of h1 and h2 tag in wordpress website. Here we will show you, how to add h1 tag to wordpress homepage in theme code.
how to add h1 tag in wordpress homepage in theme
There are many custom wordpress themes which has poor SEO. We need check every aspect of SEO friendliness of wordpress theme. recently, we faced same issue with one of our site. When we checked the website in SEO doctor Firefox addon. We did not find h1 tag on homepage. We got the following message.
how to add h1 tag in wordpress homepage in theme
When, we checked message. We found following error.
“Fail”,”H1 tag”,”* You have no H1 tags” “Fail”,”H2 tag”,”* 10 H2 tags found before/without H1 (“Demo post 12″)”
Many custom developer talking about following solution. This will not display h1 to a visitor but will to a search engine.
But we are not agree with above solution. do not use above solution. Google and other search engine did not consider hidden text or very small font words.
Solution
On Home page, For post title tag you should h1 tag. If you use multiple h1 tags in single webpage, that is not harmful. You should use rel bookmark in tag. For home page use following code.
REL=Bookmark Bookmarks are used to provide direct links to key entry points into an extended document. The TITLE attribute may be used to label the bookmark. Several bookmarks may be defined in each document, and provide a means for orienting users in extended documents.
You can use style or classes as per your theme requirement. The h1 is used in header.php for Custom Logo / Site Title, so there should be a H1 there. But If you used only logo image and not used h1 tag on home page than above issue will happen. You can use multiple h1 tags in one webpage. You can check wordpress core themes and their code and refer it. It has best SEO practice followed.
In core wordpress themes, We can see multiple H1 tags with rel bookmark element. So you can use above code in your wordpress theme and increase your website SEO.