How to Create a WordPress Plugin Part1

Thanks! Share it with your friends!


In this introduction to creating a WP plugin we will create a simple WordPress plugin. I will demonstrate the following concepts in this video tutorial:

– creating administration pages
– using the wordpress styles to create your admin styling
– interacting with the WP database using the $wpdb object

Tutorial Part 2 –
Full Blog Post –


kxmode says:

This doesn’t work in WordPress 4.0 🙁

Get the following error…

“Catchable fatal error: Object of class wpdb could not be converted to
string in ***filename.php*** on line 59″

for this code…

$myTestDrafts = $wpdb -> get_results(

SELECT ID, post_title
FROM $wpdb -> posts
WHERE post_status = ‘draft’


Ahmed Musawir says:

your video quality sux

kxmode says:

Here’s a simple way to make alternating table row colors…

if( count($myTestDrafts) > 0 ) {
$count = 1;
$class = ”;
// Loop through all items in array
foreach ($myTestDrafts as $testDraft)
$class = ( $count % 2 == 0 ) ? ‘ class=”alternate”‘ : ”;

< ?php echo " ” . $testDraft->id . ““; // Output id
echo “

” . $testDraft->post_title . “

“; // Output post title

< ?php $count++; } } else { ?>

Records not found

< ?php } ?>


Prabhu Bakiyaraj says:

Very Nice intro. Thankyou verymuch. Since i am new to development
especially to wordpress, i had a tough time for the last three days in
solving a problem with plugins. your video has solved the task for me.
thanks again. :)

CJ_Incognito says:


David Meade says:

Not new to wordpress or development but first time creating a plugin so
it’s good to get it from the very beginning. Nice intro thanks.

kunal nath says:


Visakh Mm says:

Thanx bro…..

Connell Gray says:

very well done!!

Sehui Park says:

great tutorial!!

sattar bhuiyan says:

Great. would like to share which software did you use to make this video

Arabic With Youssef says:

what I can say! it’s just wonderful! you explain the stuffs easily! Thanks

Adam Nakoneczny says:

Very good tutorial!

Nigam Kumar Tiwari says:

Thanks A lot..

OscarAnd Guti says:

Thank You!!!, The code editor is Notepad++?

Michael Hammer says:

Success! Thank you! On to Part 2…

James Sabano says:

Amazing! Just what I always wanted to learn! How to interact with
Wordpress’ db – OFFICIALLY! Thanks a million!

Safatullah Sheikh says:

It is quite great tutorials for beginner like me in plugin development.

Sam Al says:

Please help…. I have bought a web domain for my website. However, when I
go to the dashboard I can’t see plugin option appear at all. I thought when
I buy a domain it will show. I don’t understand why plugin is not there at
the dashboard 

Alex Hoang says:

You have my best gratitude sir.

Mohammad Shoeb Ansari says:


IK M says:

That was very useful. Thanks :)

Talha Sariyürek says:

Please add the used codes to the description so we can copy and paste it

Explodos says:

I’ve followed the instructions but get a error like “headers already sent”

sydcode says:

Very useful, thanks!

PulseHover - Pulse Hover Review/Bonus says:

Great video, this is my next step to make money online 😉

shotox21 says:

also .htaccess most likely

Bilal Kirmani says:

good exlanation… are the dude …hats off man….

shotox21 says:

$wpdb IS the database object, $wpdb = $WordPressDataBase You can ask
$wpdb->get_results(“SELECT * from users”); You are asking wordpress to
select all the users. Cheers!

Kais msalmi says:


shotox21 says:

Make sure your .htaccess file is configured right, it should be in the same
folder as index.php

shotox21 says:

Excellent. Thank you.

Shivendra Singh says:

Please help How to convert the particular html/css theme in to the
WordPress theme….

Bradly Spicer says:

Don’t know why this doesn’t have more views… It was genuinely a good

Explodos says:

I’m gettin a error when I click on the plugin the dashboard “You do not
have sufficient permissions to access this page.”

Comments are disabled for this post.