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

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

Notify of
avatar

Pedro du Buf
Guest
Pedro du Buf
1 month 25 days ago

Dude , thanks for this.Amazing plugin!!!

Carol
Guest
Carol
2 months 18 days ago

This is simply a copy/paste job from what's given on their site (www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-wordpress-widget/). No added understanding (which is what I was after).

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
2 months 18 days ago

Our videos are to show our steps in our articles visually rather than through text. If you feel we are missing something feel free to let us know and we will try to assist 🙂

prateek parate
Guest
prateek parate
3 months 9 days ago

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

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
3 months 7 days 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
3 months 8 days 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
3 months 8 days 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
8 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
8 months 4 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
8 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
8 months 4 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
8 months 5 days ago

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

Hassan Mahmood
Guest
Hassan Mahmood
8 months 4 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
8 months 4 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
8 months 5 days ago

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

Hassan Mahmood
Guest
Hassan Mahmood
8 months 4 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
8 months 4 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
8 months 6 days ago

how to crate custom-page in sidebar

deepak sharma
Guest
deepak sharma
8 months 6 days ago

how to crate custom-page in sidebar

Sarmad Gardezi
Guest
Sarmad Gardezi
8 months 6 days ago

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

WPBeginner - WordPress Tutorials
Guest
WPBeginner - WordPress Tutorials
8 months 5 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