Tips for Best Practices in WordPress Development

| Last Updated: | In: WP Labs

How to log in a WordPress user programmatically

When you are building a WordPress based websites, it can be very useful to know how to programmatically log in a WordPress user. Here is a function that can do it easily.

Here is the function, drop it in your functions.php file:

Then, to log in a user, do the following:

How to Disable Google Fonts in WordPress

Google fonts are very more popluar, many developers employ it in WordPress theme,I have to say the WordPress dashboard also use google fonts.Now,there is a question that come in my head, how to disable google fonts in my WordPress?

Auto Login and Redirct to Custom page after WordPress Registration

If you want ro auto user login after registration and custom url for redirect after login, then use the below code snipats :

How to use PHP in WordPress widgets
Just add following snippet to your current theme’s functions.php file:

How to use shortcodes in WordPress sidebar widgets

I think you know it,shortcode is useful.But you may can’t use shortcode in sidebar widget.To allow shortcodes in sidebar widgets, simply edit the functions.php file from your them and add the following code:

Tags: ,

About: Prem Tiwari

Prem Tiwari is the founder of and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.

You may also like:

Follow us!

Get Free Access of 400+ Scripts

Don't worry you'll not be spammed!

Featured eBook

WordPress Security Guide

Free Guide: Learn how to implement security guideline in your WordPress site...


Pincode Finder

pincode-finder tool

Online Pincode Finder

Best tool to locate post Office address and pincodes of all india...