
WordPress is not just a blogging platform and it is such a powerful CMS with unlimited capabilities, besides having a huge user base. Almost anything can be scripted with wordpress. You can extend wordpress either by means of plugin or by a theme.
In this tutorial, i will show you how to write a Hello World wordpress plugin, which unlike many believe is surprisingly easy, once you understand the very fundamentals. All you need to have is a basic knowledge of php scripting.
Before we move on coding a plugin, please make sure you remember the following coding practices.
1. Always you chose a unique name to your plugin so that it doesnt collide with names used in other plugins.
2. Make sure you comment wherever and whenever necessary in the code.
3. You will to test the plugin in your localhost (using xampp) along with latest version of wordpress.
Plugin Files & Names
Assigning unique names, documenting and organizing the plugin files is very important part of plugin creation.

Although wordpress allows you to place the plugin php file directly into the wp-content/plugins folder, for a good plugin developer you will need to create a folder named hello-world and within place readme.txt and hello-world.php.
The readme.txt contains information about your plugin and can come in handy when you submit your plugin wordpress SVN plugin repository. See the readme sample.
Go ahead and create these files and we will add the content to these files later.
The Plugin Basics
The heart of a wordpress plugins is the below 2 functions (commonly called `hooks`)
add_action ($tag, $func) documentation
add_filter ($tag,$func) documentation
It is very important to know the difference between the above functions.
- add_action –> does an action at various points of wordpress execution
- add_filter –> does filtering the data (eg. escaping quotes before mysql insert, or during output to browser.
Refer to the WordPress Plugin API for more better understanding.
Plugin Information
Open your hello-world.php and in the first line, add this commented plugin information to your file.
<?php /* Plugin Name: Hello-World Plugin URI: http://yourdomain.com/ Description: A simple hello world wordpress plugin Version: 1.0 Author: Balakrishnan Author URI: http://yourdomain.com License: GPL */ ?>
Save this php file,
- Place the plugin folder to wordpress > wp-content > plugins,
- Go to your wordpress admin > plugins and you will see the new plugin listed, waiting to get activated.
simple ain’t it?

But this plugin had to do something right?
Why not we make it print “Hello World” when we call it from wordpress theme template files.
for that we write the code using add_action below the commented plugin information in the hello-world.php
<?php
/*
Plugin Name: Hello-World
Plugin URI: http://yourdomain.com/
Description: A simple hello world wordpress plugin
Version: 1.0
Author: Balakrishnan
Author URI: http://yourdomain.com
License: GPL
*/
/* This calls hello_world() function when wordpress initializes.*/
/* Note that the hello_world doesnt have brackets.
add_action('init','hello_world');
function hello_world()
{
echo "Hello World";
}
?>
Thats it! Our Hello World plugin is nearly done and with just few lines of code. When our plugin is activated, add_action command calls our hello_world() function when wordpress starts loading.
Lets Test our Hello World Plugin
We really dont know whether our plugin works or not. To test our plugin, go to plugins, activate the hello-world plugin.
Then open your worldpress theme wp-content > themes > default, open any of index.php, archive.php or single.php and place the following code anywhere.
<?php
if(function_exists('hello_world')) {
hello_world();
}
?>
The key here is function_exists() call which checks whether plugin loaded or not and then allows the hook into the plugin function. Call to hello_world() in the theme files without checking it, often leads to “Fatal error: call to undefined function” and our blog would crash, if the hello world plugin is not activated or deleted.

If you carefully notice above graphic, see how the hello world appears. Thats the work of our plugin. It WORKS!
Lets take our plugin one step further!
Why not, we build a plugin options page in admin area and provide a backend for plugin users?
Right now, the plugin outputs hello world (its pretty much static) and if somebody wants to output ‘Hello Example’, they need to open the php file and make changes everytime to print different text.
Asking the user to edit plugin files isnt a good idea! As a wordpress plugin developer, it is you, who has to provide a good wordpress options interface in the wp-admin area.

Writing Plugin Options Page
We now create Hello World options page in the wordpress admin area.

Here is what we do….
- When plugin gets activated, we create new database field `wp_hello_world_data` using set_options() function.
- When plugin gets deactivated, we delete the database field `wp_hello_world_data`
- We create a options menu for Hello World in WordPress Admin > Settings.
- We save the user entered data in the wordpress database.
- We retrieve the data stored in wordpress database and output it using get_options() function.
Why we are creating database field? because the saved data must be saved somewhere? ie. in wordpress database. This way the plugin outputs user entered text, instead of the static “Hello World”.
Activating/Deactivating Plugin
It is very easy to write a function on what plugin does, when it gets activated. WordPress offers 4 very important functions
- register_activation_hook -> Runs on plugin activation
- register_deactivation_hook -> Runs on plugin deactivation
- add_option -> Creates new database field
- get_option -> Retrieves the value in database field.
<?php
/* Runs when plugin is activated */
register_activation_hook(__FILE__,'hello_world_install');
/* Runs on plugin deactivation*/
register_deactivation_hook( __FILE__, 'hello_world_remove' );
function hello_world_install() {
/* Creates new database field */
add_option("hello_world_data", 'Default', '', 'yes');
}
function hello_world_remove() {
/* Deletes the database field */
delete_option('hello_world_data');
}
?>
The above code creates the new database field `hello_world_data` using add_options and it runs when we activate the plugin. It has the value ‘default’ since we explicitly define it.
Similarly when the plugin gets deactivated or removed, we need to clean up things, so we remove the created database field using delete_option.
Plugin Settings Page
This is our final step. All we need to create is plugin settings page in the wordpress admin area. The settings page will update and save the data to the database field `hello_world_data` which we created while activating the plugin. Be sure to checkout creating options page in wordpress codex.
Here is a very important thing to remember:
The add_action for admin_menu should call a function hello_world_admin_menu() containing add_options_page, which in turn should call a function hello_world_html_code() containing html code. This is how the code should flow! Refer to wordpress administration menus
<?php
if ( is_admin() ){
/* Call the html code */
add_action('admin_menu', 'hello_world_admin_menu');
function hello_world_admin_menu() {
add_options_page('Hello World', 'Hello World', 'administrator',
'hello-world', 'hello_world_html_page');
}
}
?>
The above code, is placed under is_admin() which means it only runs in the wordpress admin area.
The below function has the html code for the settings page, containing the form and notice how the php tag is split to accomodate the html code.

and the coding part is..
<?php
function hello_world_html_page() {
?>
<div>
<h2>Hello World Options</h2>
<form method="post" action="options.php">
<?php wp_nonce_field('update-options'); ?>
<table width="510">
<tr valign="top">
<th width="92" scope="row">Enter Text</th>
<td width="406">
<input name="hello_world_data" type="text" id="hello_world_data"
value="<?php echo get_option('hello_world_data'); ?>" />
(ex. Hello World)</td>
</tr>
</table>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="page_options" value="hello_world_data" />
<p>
<input type="submit" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
<?php
}
?>
You must remember 2 things in the above code.
1. Specify the database field we created before in the input text box as `hello_world_data`
<input name="hello_world_data" type="text" id="hello_world_data"
value="<?php echo get_option('hello_world_data'); ?>" />
2. If your form has number of fields (like textbox, selectbox etc), all those should be listed in the value field of page_options, separated by commas. For more information, refer to wordpress documentation
<input type="hidden" name="page_options" value="hello_world_data" />
Now, the plugin outputs whatever the user specifies in the hello world settings page.
Thats it! Our plugin is READY!
Dont forget to add documentation to readme.txt.
Enjoy!
___________________________________________
Save time in your website design using these 20 really useful cheatsheets for web designers.
Testking offers latest 70-432 questions and 70-620 study guide to help its candidates pass 70-640 exam on first try.
Similar Posts:
- WordPress – how to add custom field when post is published?
- Fix ->Wordpres plugin could not be activated fatal error cannot redeclare!
- Affiliate Hide – Free wordpress plugin to redirect affiliate links!
- Fix -> Fatal error – Call to undefined function: screen_icon() in WP-Pagenavi Plugin
- Affiliate Hide v1.0 – Free WordPress plugin to Hide & Redirect Affiliate Links
- Where does wordpress store htaccess rewrite rules?
- PHP code to filter input against XSS/Injection attacks
- How to filter & escape data from Injection attacks in PHP!
- How to manually upgrade wordpress from older versions
- Quick & Easy Form Validation Tutorial with JQuery





January 3, 2010
Thanks for that! This is a great first step for making a plugin.
May 28, 2011
it is very hard for me to learn
October 4, 2012
This is a great help site , any programmer have basic knowledge of php able to learn how we create a plugin .
Thanks again……….
January 5, 2010
Balakrishnan,
I am Girish from dotgiri.com , I just want to congratulate you on writing such a great post . I never see such a simple step by step method to write a plugin.
It really helped
keep going
August 1, 2012
Great Tutorial. . .
January 14, 2010
Hi
Great tutorial! Followed it and get the following 2 problems!
Hello World has appeared at the top of the ADMIN screen after activation!
When I try and edit a page in my template i get
Cannot modify header information – headers already sent by etcetc
Do you know what the problem is?
Thanks in advance
Mat
January 14, 2010
I deactivated the plugin and was able to insert the code into the PAGE.php file ok and it comes up! But it also comes up in the home page like it does in the admin page? Any ideas? Cheers mat
January 14, 2010
The code should be placed in index.php or single.php and not in other pages. I checked it and worked fine for me.
January 15, 2010
Sorted!
The line is missing the*/ at the end
/* Note that the hello_world doesnt have brackets.
November 28, 2012
ob_start() function could be help for this problem. i am not sure.
January 14, 2010
thamks…….for the nice pluging tutorial.
January 30, 2010
Hello,when I put in “init” in add_action(‘init’,'myfnc’) it doesn’t work,this error is shown :
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wp\wp-content\plugins\test\test.php:13) in C:\xampp\htdocs\wp\wp-includes\functions.php on line 790
but when I put for example add_action(‘get_header’,'myfnc’) or any other action tag,it works fine.
Init is use to run after WordPress has finished loading but before any headers are sent.
Any idea,how to make it work,how to use init function?This doesn’t work for me
tnx
February 22, 2010
“Init” will be executed before everything else.
so, there is an echo “Hello World” inside the function which is called by init.
You need to comment that echo when you are writing the code for plugin activate or deactivate. I faced the similar error but not the same as the exact one. I hope it works.
May 6, 2010
If you comment the echo, then nothing appears on the page…
I’m getting this same error and I’m really confused. It appears there were some steps left out of the tutorial. For instance, if the plugin is supposed to display whatever someone types in the hello_world_data field, then when do we change the echo code to pull the data from that field? I’ve tried modifying this code several different ways and all I get it errors.
May 8, 2010
Found the missing instructions:
delete the init line
replace echo “Hello World”;
with echo get_option(‘hello_world_data’);
That will show your options data wherever you want to display it will not give you the headers error.
October 18, 2010
correct?
May 7, 2011
Delete the init line? Do you mean the add_action( statement? That can’t be right. Please explain..
February 5, 2012
don’t delete the add_action statement
simply replace echo “Hello World”;
with echo get_option(‘hello_world_data’);
January 14, 2012
I solve that fully and here is the code.I think it may help you. the file is hello.php
hello.php file:
Hello World Options
Enter Text
<input name="hello_world_data" type="text" id="hello_world_data"
value="” />
(ex. Hello World)
<input type="submit" value="” />
February 23, 2010
Your blog is amazing, i first landed to another post but then get interested and thought, i will just look a little more arround to see what else i can find out about best plugins arround.
April 12, 2010
Nice article. It would have been cool if you had a few links on releasing information too. Another issue to discuss is that of licensing. A relevant article:
http://wpsplash.com/licensing-explained-for-wordpress-theme-and-plugin-developers/
April 27, 2010
Thanks
For the Nice Tutorials.
May 14, 2010
i understand we’re saving info to the db, but only wp_options db. My plugin is created a new table, and I want to save my info from the text input to a brand new table I’ve created when the plugin was installed. Tips on how to do this?
June 17, 2010
HI
thanks bro, this is such a great tutorial. it is simple steps and very easy to fellow.
June 18, 2010
hi. i couldn’t get what it does option.php file. can you show us the file please.
July 15, 2010
This gives me a good start to create wordpress plugin. Very simple tutorial.
Thanks a lot.
August 4, 2010
I followed your tutorial, and it worked fine until I tried to save the form. When I click the “save” button the following url causes a file not found error: http://www.mysite.com/administrator/options.php.
I checked in the administrator folder and there is no option file there.
This is the url that displays the form http://www.mysite.com/administrator/index.php?option=com_wordpress&task=options-general.php&page=hello-world
Shouldn’t the save url be similar?
August 27, 2010
Darn! You really did explain this SO well! I’m glad I dropped by. Thank you so much!
September 15, 2010
The plugin is supposed to create a new database table when activated right? I checked my database and it got no new table “hello_world_data” and when I save the form it will only post a hello world line and no other.
I double-checked the codes and I am sure I followed the tutorial right.
Any help?
September 15, 2010
check under wp_options table
September 15, 2010
I just went to wp_options table and it is still not there. I deactivated and activated the plugin again and still no “hello_world_data”.
February 3, 2012
It doesn’t create a new table.
Check in wp_options, you’ll see a new row with the ‘option_name’ field populated with a value of ‘hello_world_data’ and the ‘option_value’ field of the table is populated with what ever you enter into wp-admin > settings > Hello World
June 22, 2012
i new for codding but this site its very useful for me.thanks
October 14, 2010
This is really helped us. Thank a ton!
October 14, 2010
This is really helped us. Thanks a ton!
October 18, 2010
It’s a good tutorial for beginners, thanks a lot…
December 8, 2010
Great tutorials, but I got a problem the text I input in the back-end always shows in the front-end and back-end when the plugin activated.
what should this error?, is there I missed something?
Please help
Thanks
December 29, 2010
Thanks, this tutorial solved my problems with the options being not saved. The WordPress Doku is not really good as it mixes all those different methods that evolved during its evolution to version 3.
January 1, 2011
hi,
Thanks and sorry.
Because, i am not clear that the write pluging option area,where i write theses code for update or delete hello_world_data …
can u clear it?
Thanks,
January 18, 2011
hi..
great article.
i do a new plugin, but I have this message of warning:
Warning: Cannot modify header information – headers already sent by….
I already view the solutions with del the space in plugin file, but i not resolved the error.
do you i hava any idea?
sorry for my english, I’m italian.
February 23, 2011
Simple and effective tutorial. kudos on that but I want to take the plugin into the next level by creating new tables to store some data and display them in the front end. Any pointers on how to do that?
February 25, 2011
Hi
Thank you for a great tutorial. I have created my first plugin with your help.
And it works fine – almost.
Form action is option.php. The values of the fields are registrated in the database and those values are printed in the frontend.
But, when submitting – the option.php is blank. But still it registrates the values in the database. I have tried to set another action value, with no success.
Any idea what the solution is? I want to load the same page again.
Regards Malin
March 7, 2011
I have solved it myself.
It looks like the code in a wordpress plugin doesn’t like double php-tags.
I had three ends and starts of php like without any html code in between:
?> <?php
After deleting those, everything works fine!
/Malin
October 6, 2011
you are the man!
December 18, 2011
thanks! removing all of the ?><?php from the code it works perfect! you can leave all of the value=" filled. also the options.php stays where it is. options.php is a core file in wp-admin folder and required to save stuff in your database.
August 19, 2012
To be clear, you need to remove the last closing php tag..
ie
otherwise a blank page shows up
February 28, 2011
Gr8 tutorial….
March 2, 2011
This is a great step-by-step tutorial. Thanks.
March 4, 2011
nice tutorial buddy
March 6, 2011
Great tutorial! Thank you so much!
March 21, 2011
This is a really gr8 step-by-step Plugin for wordpress. Thanks.
March 24, 2011
Nice tutorial. Simple and well presented. Thanks.
March 25, 2011
I have make a new table when i activate my plugin. I want to entry the data to this table from the text box from the admin section. But i don’t know how to insert the data dynamically from the admin section. So, please explain this by writing a code
March 25, 2011
thanks……. its a nice tutorial.
March 29, 2011
Thanks Nice i waill try
April 8, 2011
Hi, Thanks Dear, This is really a wonderful artical for the beginners… Thanks a lot..Keep doing great work……
April 9, 2011
Great Job.. quick and easy and it works ! Best way to learn by doing!
Keep it up!
April 15, 2011
Hi nice tutorial, I learned alot.
Can you please let me know how to make it as widget
April 15, 2011
Got it thanks
April 16, 2011
Hi Can you please show us using drop down list items.
April 28, 2011
great. thanks
May 7, 2011
This would really be great if a few of the errors were corrected. The value of this helpful tutorial is almost negated by a few key errors that prevent it from working as expected
May 15, 2011
I tried this on wordpress 3.1.2. There it does not require the function_exists check code to print hello world it prints automatically. But when trying to log out it shows the message “Hello World” and following warnings…
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\plugins\hello\hello-world.php:18) in C:\xampp\htdocs\wordpress\wp-login.php on line 354
Warning: Cannot modify header information – headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\plugins\hello\hello-world.php:18) in C:\xampp\htdocs\wordpress\wp-login.php on line 366….
….and the list goes on!!
Help me!
May 15, 2011
You are echoing (sending browser html output) which is what causing headers sent warning. printing something should happen after the php sessions are loaded.
May 16, 2011
Great Tutorial, I’m in the process of writing my own tutorial for my website just to document what I teach myself. I made a simple RSS parser that takes 5 links and (IS SUPPOSED TO) add them to then end of a post, but I cant seem to get them to appear at the end, instead they appear at the front.
function WP_Append_The_Links($content)
{
return $content.Wp_Get_The_Feed();
}
get the feed just echos the links
Any help would be greatly appreciated.
May 21, 2011
Thanks
after searching a loooong i have found you
hope this will work for me
June 8, 2011
This works fine, however “hello world” appears on the top of every single page of my website, even the wordpress admin area.
Any clue why it does that? It also appears when you place the function to call it (which is right).
February 3, 2012
Try in hello-world.php –
add_action(‘init’,'hello_world’);
function hello_world()
{
return get_option(‘hello_world_data’);
}
note ‘return’ instead of ‘echo’
And then in your template file such as page.php or single.php try this –
Note the added ‘echo’
February 3, 2012
Take 2, sorry, didn’t paste in all my code –
Try in hello-world.php –
add_action(‘init’,’hello_world’);
function hello_world()
{
return get_option(‘hello_world_data’);
}
note ‘return’ instead of ‘echo’
And then in your template file such as page.php or single.php try this –
Note the added ‘echo’
February 3, 2012
Take 3!, I don’t think this form likes my php tags and stripped out my code –
Try in hello-world.php –
add_action(‘init’,’hello_world’);
function hello_world()
{
return get_option(‘hello_world_data’);
}
note ‘return’ instead of ‘echo’
And then in your template file such as page.php or single.php try this –
if(function_exists(‘hello_world’)) {
echo hello_world();
}
Note the added ‘echo’
April 5, 2012
Thank you! That worked for me. Now the text doesn’t show up at the top of every page, but only where I put the code snippet.
December 13, 2012
This worked for me, too. The function can be even more simple by return ‘hello world’;
vs return get_option(). the point is, use a return not an echo.
June 21, 2011
I learned plugin building by this post and created one for me.
Thanks to author.
June 24, 2011
Nice,this is what i wanted,
July 1, 2011
Hi ,
I really don’t get this….How many files are needed?
1. hellodolly.php
2. Options.php
3. settings.php
or only 1 & 2 and with or without all the
can anyone please show the complete files please?
thanks
July 2, 2011
I hope you can help…
you start off by telling us to create Hello_World.php and later mention the options.php, but you don’t unfortunately show us which part goes where.
I have tried all sorts of combinations with different files, entering the above code but I can’t get any further than echo “Hello World” in a post.
The admin and setting/database are not created…
Please help, if I can see this once..the next are easy and I can’t find another tutorial with examples to create the admin page.
I sincerely hope you help
thanks
Bobo
July 2, 2011
just wanna help
1.this tutor only have one file “hello-world.php”
2.this tutor does not create a table but insert value in wp_option table.
3.”header already sent” its error occur couse there is output in file.
here the right code :
Hello World Options
Enter Text
<input name="hello_world_data" type="text" id="hello_world_data"
value="” />
(ex. Hello World)
<input type="submit" value="” />
July 3, 2011
well I finally got this working with a few minor changes.
I personally like to see a complete picture at the end of an explanaition instead of bits and pieces that one has to put together so this is what I ended up with and it works perfectly in wp 3.14:
ONE file: Hello-World.php:
———————————–
/*
Plugin Name: Hello-World
Plugin URI: http://yourdomain.com/
Description: A simple hello world wordpress plugin
Version: 1.0
Author: Balakrishnan
Author URI: http://yourdomain.com
License: GPL
*/
/* This calls hello_world() function when wordpress initializes.*/
/* Note that the hello_world doesnt have brackets.*/
/*add_action(‘init’,'hello_world’);*/
/*———————————————————————*/
/* Runs when plugin is activated */
register_activation_hook(__FILE__,’hello_world_install’);
/* Runs on plugin deactivation*/
register_deactivation_hook( __FILE__, ‘hello_world_remove’ );
function hello_world_install() {
/* Creates new database field */
add_option(“hello_world_data”, ‘Default’, ”, ‘yes’);
}
function hello_world_remove() {
/* Deletes the database field */
delete_option(‘hello_world_data’);
}
/*———————————————————————*/
if ( is_admin() ){
/* Call the html code */
add_action(‘admin_menu’, ‘hello_world_admin_menu’);
function hello_world_admin_menu() {
add_options_page(‘Hello World’, ‘Hello World’, ‘administrator’,
‘hello_world’, ‘hello_world_html_page’);
}
}
/*———————————————————————*/
/*———————————————————————*/
function hello_world_html_page() {
?>
Hello World Options
Enter Text
<input name="hello_world_data" type="text" id="hello_world_data"
value="” />
(ex. Hello World)
<input type="submit" value="” />
<?php
}
function hello_world()
{
echo get_option('hello_world_data');
}
——————————–
and the following pasted into any .php file where you want to show it:
July 3, 2011
oh well….seems one can’t paste the code in here…sorry
September 6, 2011
@bobo, can you describe the code you couldn’t past – ran into the same issues (I think) that you did and was hoping to use your solution…thanks!
July 9, 2011
This is the great example understanding the basics of plugin development. Thank you for publishing such a easy to understand tutorial.
July 10, 2011
i have read some of your post and happy to see but… can you please tell me how can i use tag on plugins
July 11, 2011
hello
i write the codes to a hello_world.php, i see in the settings menu, and teh plugin menu, no problem with this, but shows nothing on index. it dont write any warning or any problems. i hope understand what i write(i cant speak too good) and help me.
July 17, 2011
thanks for simple tutorial keep it up.
July 19, 2011
This is the best WordPress tutorial I have ever read. Thanks for making it easy to read!
July 20, 2011
Great first steps article. Why can’t people write these types of intro articles for everything.
July 20, 2011
Great!. however can you teach me create an pluging, which can display content on the page, it seem a product plugin. display product, category, but without checkout and add to cart.
thank you so much.
August 8, 2011
Just starting my first plugin thanks for this tutorial. I need to insert and change a line of code in the loop and one other file. I noticed you added the code to the template manually in this post. Is there a way of making the plugin add it?
For example, I need to add get_sidebar to single.php before the get_footer then I need to add a line to the loop before the excerpt call and change is_search to is_search || is_home in the loop
August 18, 2011
great tutorial, pbu. very easy to follow. glad i stumbled on it.
thanks for your time.
August 23, 2011
thx man, really great tutorial
August 30, 2011
Great toot!. Working on a plugin that will create a page and display the coupon database in an iframe. Thank again.
September 9, 2011
Wow! So many comments. Thanks guys. It took me about 12 hours to write this tutorial. Glad to know its well worth it. I am the author of this blog and tutorial. Thanks
September 22, 2011
Simple and straight forward thanks for providing 1st step towards Plugin development
October 6, 2011
Thanks for this nice tutorial.
May 16, 2013
You actually make it seem so easy with your presentation but I find this topic to be actually something which I think I would never understand.
It seems too complex and extremely broad for me.
I am looking forward for your next post, I’ll try to get the hang of it!
October 6, 2011
Thanks for that awesome beginner tutorial. Everything works fine, besides one thing.
I’m using version 3.2.1. No matter where I place the call for the function
The ‘Hello World’ statement is somehow places at the very beginning of the document even before . Anyone any ideas?
October 24, 2011
thanks its too good for beginners
November 25, 2011
hi,
All is well, but the short code to display in page(plugin)
plz reply Soon
November 27, 2011
Everything is perfect except the fact that I can’t figure out what files should I create, where should I put the pieces of code… what files I would end up with?
What about the “option.php” that’s the action file for the form? What does it contain? Where to put it?
This is why I hate programmers documentation. Good info, nice presentation, just 15% missing bits!
December 1, 2011
Thanks! this is very simple and well formatted. I required exactly this to get started on creating wordpress plugins
December 12, 2011
Thanks for this tuitorial
December 19, 2011
This is it! i learn and trying create some smileys plugin, and it works!
December 23, 2011
Great intro to writing a wordpress pluggin. +10 to you!
December 23, 2011
Really good tutorial! I’m having problem adding more than one page to the plugin. When I all a secondary page, for “insert into” code i get an error
“You do not have sufficient permissions to access this page.” I have been digging around for hours now and can’t find how its dun any advice?
August 3, 2012
The problem is the fourth parameter. Replace the white spaces with _ and it should work. You can read more here:http://stackoverflow.com/questions/4224084/wordpress-error-while-developing-a-plugin-you-do-not-have-sufficient-permissio
I had the same problem and the solution that I found in that forum worked like a charm.
August 3, 2012
Sorry, I did not explain it properly. What I did exactly to solve the problem is to replace the forth parameter with the name of the file. In the case explained in this tutorial would be:
add_options_page(“OSCommerce Product Display”, “OSCommerce Product Display”, 1, “oscommerce_import_admin”, “oscimp_admin”);
Joe, I know you posted this message a long time ago, and I’m pretty sure you have already solved this. However, I thought it could help others!
December 30, 2011
It is very wonderfull tutorial for those who are in first stage.
Thanks,
Fawwad Ali Khan
Web Developer
January 11, 2012
HI..
I have try to create a plugin. below is mycode
Set Home page Title,Image,Description
Buy Details
Buy Title
<input name="buy_tilte" type="text" id="buy_tilte"
value="” />
(ex. Hello World)
Page Url
<input name="buy_tilte_url" type="text" id="buy_tilte_url"
value="” />
Image Url
<input name="buy_image_url" type="text" id="buy_image_url"
value="” />
Sell Details
Sell Title
<input name="sell_tilte" type="text" id="sell_tilte"
value="” />
(ex. Hello World)
Page Url
<input name="sell_tilte_url" type="text" id="sell_tilte_url"
value="” />
Image Url
<input name="sell_image_url" type="text" id="sell_image_url"
value="” />
Share Details
Share Title
<input name="share_tilte" type="text" id="share_tilte"
value="” />
(ex. Hello World)
Page Url
<input name="share_tilte_url" type="text" id="share_tilte_url"
value="” />
Image Url
<input name="share_image_url" type="text" id="share_image_url"
value="” />
Enjoy Details
Enjoy Title
<input name="enjoy_tilte" type="text" id="enjoy_tilte"
value="” />
(ex. Hello World)
Page Url
<input name="enjoy_tilte_url" type="text" id="enjoy_tilte_url"
value="” />
Image Url
<input name="enjoy_image_url" type="text" id="enjoy_image_url"
value="” />
<input type="submit" value="” />
The above code not updated all values in database.. only one value has updated..
How will i do.. and how to call this value in theme(front end).. kindly response as soon as possible
January 11, 2012
HI..
I have try to create a plugin. below is mycode
The above code not updated all values in database.. only one value has updated..
How will i do.. and how to call this value in theme(front end).. kindly response as soon as possible
April 5, 2012
if(is_admin()){
add_action(‘admin_menu’,'front_end_image’);
function front_end_image(){
if ( count($_POST) > 0)
{
$options = array (‘buy_tilte’, ‘buy_tilte_url’, ‘buy_image_url’, ‘sell_tilte’, ‘sell_tilte_url’, ‘sell_image_url’, ‘share_tilte’, ‘share_tilte_url’, ‘share_image_url’, ‘enjoy_tilte’, ‘enjoy_tilte_url’, ‘enjoy_image_url’);
foreach ( $options as $opt )
{
delete_option ( $opt, $_POST[$opt] );
add_option ( $opt, $_POST[$opt] );
}
}
add_options_page(‘Home Images’,'Home Image’,'administrator’,'home_image’,'add_home_image’);
}
}
February 7, 2012
Great post. It was very helpful!
February 15, 2012
nice tutorial plugin …
February 17, 2012
Thank you. I have successfully used your useful tutorial to create my first plugin:
http://www.tautologicalcode.net/wordpress-plugin-wp-really-simple-health/
ciao
Tiberius14
February 18, 2012
Nice One..
This is most helpful tutorial for creating a plugin..
February 19, 2012
Very good tutorial, but I just want to clarify: do I add the activation/deactivation/setting up plugin settings page (I mean: ) inside one script: options.php or can I just put in inside hello-world.php?
March 5, 2012
Very good tutorial, but I just want to clarify: do I add the activation/deactivation/setting up plugin settings page (I mean: ) inside one script: options.php or can I just put in inside hello-world.php?
March 22, 2012
Great article…….
Thank you very much
March 24, 2012
wow that great tutorial…!
hello admin, i never make a plugin before but i have plugin that i download a few day ( global search ) and i want to add this plugin to my page (just like sample page ), could you tell me how to do that,please?
share to my mail when you have post new article about my question, i am waiting for that!
March 30, 2012
What I am curious about is, once you develop the plugin, is there anything you need to do to protect your plugin in that way other people don’t have the ability to either steal your work or be able to change it?
April 4, 2012
nice tutoial for learner.
April 5, 2012
nice tutorial plugin …
April 11, 2012
Thanks for clear basic idea about WP plugin
April 17, 2012
Awesome!!!
I just made my first plugin!!! Thanks!!!
It is available at: diana-freelance.co.za/myplugins/payfast-plugin.zip
April 24, 2012
I customized the plugin accordingly, but i wanna know where do the data is being stored in the MySQL database, i am unable to locate the database field!
any suggestions
April 24, 2012
very good tutorial for a novice!
May 11, 2012
I am trying to customize a plugin which i acquired and your tutorial was really helpful.
Thanks
May 15, 2012
I have learnt a lot from your tutorial. Now i am a basic wordpress plugin developer.
Thanks PBU
May 23, 2012
This is very useful comment for me.
Thanks.
SardarR
May 26, 2012
I am getting following error message :
/public_html/blog/wp-includes/functions.php on line 861
Warning: Cannot modify header information – headers already sent by (output started at /home/rcitbd/public_html/blog/wp-content/plugins/hello-world.php:14) in /home/rcitbd/public_html/blog/wp-includes/functions.php on line 862
how i solve it?
Thanks.
June 4, 2012
I tested various tutorials “How to make a Adminpage in WordPress”. Your tutorial was helpful. Thanks.
June 20, 2012
Really nice blog having step by step instructions for building a plugin.I was searching from the past 2 weeks for this tutorial.thank God,at last,i got yours.really great!!!!
June 20, 2012
Full perfect code.It works:
Hello World Options
Enter Text
<input name="hello_world_data" type="text" id="hello_world_data"
value="” />
(ex. Hello World)
<input type="submit" value="” />
June 20, 2012
Code here.Its works fabulous-
June 29, 2012
thanks it works great
July 14, 2012
Great. This tutorial is detailed. Thank for this tutorial
July 18, 2012
Hello This is very easy to understand to how to create a plugin in word press
July 20, 2012
please reply,i need ur help.if i want to display the latest post by one day,how to output my plugin.i tried a lot.but, all in vain.
July 26, 2012
These post is really helpfull foe wordpress begainers. Gr8 Work
August 3, 2012
its nice but its not clear which part to place which place…
May 16, 2013
I read this article fully concerning the resemblance of newest and preceding technologies, it’s amazing article.
August 4, 2012
really a very good post to those who wants to create their own plugin.
August 23, 2012
Step by step learning wordpress. Thanks for the post.
August 29, 2012
Very nice Tutorial, Thanks a lot.
August 30, 2012
Thanks Its really helpful.
September 2, 2012
Are these paid comments? Why don’t you bother checking your code.
You should’ve closed the comment in line:
/* Note that the hello_world doesnt have brackets.*/
Not a good tutorial!
September 11, 2012
Hello
I have gone through the tutorial and it seems to work just great until I clicked the “Save Changes” button, then I get the following error:
Warning: Cannot modify header information – headers already sent by (output started at /home/content/52/8983752/html/ectpro/wp-content/plugins/hello-world/hello-world.php:32) in /home/content/52/8983752/html/ectpro/wp-includes/pluggable.php on line 866
How do I fix this?
September 22, 2012
I found that it was because somewhere outside of my php tags I had extra empty lines. For example:
?>
there was extra spaces. Or before the first <?
September 14, 2012
Very nice Tutorial, it works great thanks…
May 16, 2013
Sweet blog! I found it while searching on Yahoo News.
Do you have any tips on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there! Appreciate it
September 27, 2012
nice great tutorials
September 30, 2012
Thats a very nice tutorial and i have used it to understand and start writing my own plugin.
Regards.
October 7, 2012
Its nice tutorial..
First time iam going to develop a Plugin , here is the concept of the plugin
1. Customer/ Client fills up a form from website, will be recorded in WordPress
2. In Admin view all the submitted records are displayed (Submitted Forms – Sheet)
3. Admin is able to create a new quote or delete the record (Submitted Forms – Sheet)
4 Upon clicking create new quote, admin is directed to a form (Quote Generate -Sheet)
5. Admin can edit and input values then either ‘save’ or ‘save and send quote’ (Quote Generate -Sheet)
6. Admin can view added Quotation report and can able ‘Send PDF’ or ‘Edit’ or ‘Add Payment to Quote’ (Quotation Report – Sheet)
7. Once clicked on ‘Add Payment’ button, he is re-directed to another form where he can add Amount paid, date of payment, method of payment, then he either saves it or send as PDF (Payment Recording -Sheet)
8. Its complete view of the enrollment process and finalized clients who paid for the services (Enrollment – Sheet)
Plz give me suggestions to develop this type plugin.. In one we can say that it was related to Dynamic Form Creating.
October 12, 2012
Great Tutorial. . .
November 8, 2012
Thanks for the descriptive explanation.
November 9, 2012
it is very nice for the beginners. thanks a lot
November 14, 2012
really thanks from heart for writing such great snippet for beginners
November 15, 2012
Really Good Tutorial for plugin starting.
November 21, 2012
hey buddy i need to create a plugin for my wp site which is http://awesomemoviez.com/
in that plugin i want that for a movie list it will get poster instead of name of the file so can u help me in this …..
December 7, 2012
Thanks a lot. Great Tutorial. Very easy to understand.
January 31, 2013
Hi,
I am able to display the form in admin area…
But it isn’t getting saved in database…
and html form contains options.php..what would be the content of options.php and where it should be saved….
“<input name="hello_world_data" type="text" id="hello_world_data"
value="” /> ”
I want to confirm if textbox will contain the value already in database or it will be always blank..
February 1, 2013
AWESOME! This is exactly what I was searching for & after hours of searching, I finally found an excellent tutorial that makes sense. Thanks for the share PBU.
February 12, 2013
This is a very good for beginner to start in wordpress plugin development.
March 12, 2013
simple to learn, Easy to implement thank you:-}
March 26, 2013
Nice to read your post. I am new to plugin development.
April 1, 2013
great tutorial boss and nice write. You have just missed mentioning about option.php where the forms content are saved and updated otherwise it would have been a best example.
April 4, 2013
really , it helps me…….thanx
April 20, 2013
Really Helpful,
I was searching for such tutorial and its the best one.
May 7, 2013
Respectede sir
I am Creating as you say the first plugin but when i create the second one there are trouble. after creating my plugin how can i put to my web pages. or where i put it . for ex : first plugin you say that put it in index.php one function . thats this second plugins how can i put ??