Published on November 13, 2017 by WPBeginner

Are you wanting to create your own custom widget for WordPress? Widgets are tools to let you add elements to any sidebar or widget ready area of your website. In this video we will show you how to create a custom WordPress widget.

Text version of this tutorial
www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget/

If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.

Check us out on Facebook
www.facebook.com/wpbeginner

Follow us on Twitter
twitter.com/wpbeginner

Checkout our website for more WordPress Tutorials
www.wpbeginner.com

There are two methods to do this you could either create a site specific plugin or paste the code in your theme’s functions.php.

If you edit your theme’s functions.php then you will lose the widget when you change themes so keep this in mind when making these changes.

If you do not know how to use FTP you would want to take a look at our article:

www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/

You will want to download your theme’s functions.php from the wp-content/themes area inside the folder with the name of your theme.

Download and add the code from our written article to the functions.php file and upload it back to your theme’s folder.

You should now have a widget that you can add under Appearance, Widgets to your site.

Leave a Reply

20 Comments on "How to Create a Custom WordPress Widget"

Notify of
avatar

prateek parate
Guest
prateek parate
8 days 8 hours ago

after putting this code into function.php widget is not appear

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
7 days 2 hours ago

If you are writing the code you may want to take a look at our written article where you can directly copy it: www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget/
As the video cannot display the entire code.

prateek parate
Guest
prateek parate
7 days 12 hours ago

Firstly I watch your video 2–3 times then I write the code properly and there is no error in that also

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
8 days 4 hours ago

You may want to check that you pasted the code properly and if you customized it the code may display as something else.

Terrence Evins
Guest
Terrence Evins
5 months 4 days ago

Hi I'm having a problem with my images on WordPress. I can upload them just fine and click on them and the blue arrow will pop up but when I click on the blue button to the lower right that says select image it just ignores it and nothing happens do you know what's the problem?

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
5 months 3 days ago

You may want to try the steps in: www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/ to see if that resolves the issue

Terrence Evins
Guest
Terrence Evins
5 months 4 days ago

Hi I'm having a problem with my images on WordPress. I can upload them just fine and click on them and the blue arrow will pop up but when I click on the blue button to the lower right that says select image it just ignores it and nothing happens do you know what's the problem?

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
5 months 3 days ago

You may want to try the steps in: www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/ to see if that resolves the issue

Hassan Mahmood
Guest
Hassan Mahmood
5 months 4 days ago

Great video.Please create a video about how we can make different style of post in WordPress.

Hassan Mahmood
Guest
Hassan Mahmood
5 months 3 days ago

It is also a nice tutorial. But i want something other like that how we can create a column in my post where i can show pictures. And create different type of tables.

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
5 months 3 days ago

If you mean custom post types you would want to take a look at: www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/

Hassan Mahmood
Guest
Hassan Mahmood
5 months 4 days ago

Great video.Please create a video about how we can make different style of post in WordPress.

Hassan Mahmood
Guest
Hassan Mahmood
5 months 3 days ago

It is also a nice tutorial. But i want something other like that how we can create a column in my post where i can show pictures. And create different type of tables.

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
5 months 3 days ago

If you mean custom post types you would want to take a look at: www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/

deepak sharma
Guest
deepak sharma
5 months 5 days ago

how to crate custom-page in sidebar

deepak sharma
Guest
deepak sharma
5 months 5 days ago

how to crate custom-page in sidebar

Sarmad Gardezi
Guest
Sarmad Gardezi
5 months 6 days ago

This is nice. Tell me can i take a backup of widgets ?

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
5 months 4 days ago

You could add them in the inactive widgets area at the bottom but not a simple method for having a backup of your widget configuration.

Sarmad Gardezi
Guest
Sarmad Gardezi
5 months 6 days ago

This is nice. Tell me can i take a backup of widgets ?

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
5 months 4 days ago

You could add them in the inactive widgets area at the bottom but not a simple method for having a backup of your widget configuration.

wpDiscuz