Menu Search
Jump to the content X X
Smashing Conf Barcelona

You know, we use ad-blockers as well. We gotta keep those servers running though. Did you know that we publish useful books and run friendly conferences — crafted for pros like yourself? E.g. our upcoming SmashingConf Barcelona, dedicated to smart front-end techniques and design patterns.

Powerful WordPress Tips And Tricks

I’ve been working with WordPress since the dawn of time, and even though I peek at the source code regularly, I still discover new tips and tricks. I’ve compiled my own list of 21 techniques that are handy, clever, fun or best practices rarely followed. I hope everyone finds something new in the list!

21 tips1

1. WordPress Has A Ton Of Built-In Scripts Link

Using the great wp_enqueue_script() and wp_enqueue_style(), you can include styles and scripts easily with dependency management. But did you know that WordPress has a lot of scripts already built in? jQuery, many elements of jQuery UI, jQuery Form, SWF Object, Tiny MCE, Jcrop and Thickbox are just some the better known ones. The whole list can be found in the WordPress Codex2. If you’re interested in learning how to use the enqueue functions effectively, I recommend “The Developer’s Guide to Conflict-Free JavaScript and CSS in WordPress3” right here on Smashing Magazine!

Further Reading on SmashingMag: Link

2. Replace Built-In Scripts By Deregistering Them Link

If you live on the bleeding edge, you can use versions of scripts other than the built-in ones. Using a newer jQuery version is common (though not necessarily good) practice, which can be done in the following way.

function my_scripts_method() {
   wp_deregister_script( 'jquery' );
   wp_register_script( 'jquery', get_template_directory_uri() . '/js/jquery-new.js');
   wp_enqueue_script( 'jquery' );
add_action('wp_enqueue_scripts', 'my_scripts_method');

But do not do this just to brag about using latest stuff. WordPress includes the version of jQuery that it does to ensure maximum compatibility.

Use another version of jQuery only when encountering compatibility issues, such a plugin that specifically requires it.

3. Force Perfect JPG Images Link

This is a classic example of why working on a team is beneficial. My good friend Lars told me that WordPress doesn’t use 100% quality for images served on the website, to conserve space and bandwidth. He also showed me a solution, of course:

add_filter( 'jpeg_quality', 'smashing_jpeg_quality' );
function smashing_jpeg_quality() {
   return 100;

WordPress uses a default quality of 90%. This is fine in most cases; I doubt many people can see the difference. But if top-notch image quality is a must on your website (for a portfolio, photography, etc.), modifying the value might be best.

4. FeedBurner Redirection Link

FeedBurner is used on almost every blog that I’ve worked on, and yet I never know how exactly to set it up by heart. Thanks to Elio for writing “10 Tips to Optimize Your WordPress Theme8,” which contains this snippet:

add_action( 'template_redirect' , 'smashing_rss_redirect');
function smashing_rss_redirect() {
   if ( is_feed() AND !preg_match( '/feedburner|feedvalidator/i', $_SERVER['HTTP_USER_AGENT'] ) ){
      header( 'Location:' );
      header( 'HTTP/1.1 302 Temporary Redirect' );

5. Using General Taxonomy Functions Link

A number of taxonomy functions can handle your custom taxonomies as well as the built-in tags and categories. The Codex’s reference of functions9 contains the full list of taxonomy functions. I particularly like using get_term(), get_terms() and wp_get_object_terms(). To make things more modular, I use these functions as much as I can, even for tags and categories.

6. Setting Up Sessions In WordPress Link

Sessions are great for storing information between pages and are widely used on websites. WordPress doesn’t use them at all internally, so the session is never set. Using the following method, you can start a session on all pages before any output.

add_action( 'init', 'smashing_session_start' );
function smashing_session_start() {
   if ( !session_id() ) {

Note that, while sessions are generally pretty safe, implement IP checking or added nonce protection just to be on the safe side. As long as you’re transmitting non-sensitive data, though, you’ll fine. Check out Mark Jaquith’s great article on nonces10 for more info.

7. List All Hooked Functions Link

I started writing a function to do this. When I did a quick Google search, it turned out that WP Recipes had exactly11 what I needed.

function list_hooked_functions($tag=false){
   global $wp_filter;
   if ($tag) {
      if (!is_array($hook[$tag])) {
         trigger_error("Nothing found for '$tag' hook", E_USER_WARNING);
   else {
   echo '<pre>';
   foreach($hook as $tag => $priority){
      echo "<br />&gt;&gt;&gt;&gt;&gt;t<strong>$tag</strong><br />";
      foreach($priority as $priority => $function){
         echo $priority;
         foreach($function as $name => $properties) {
            echo "t$name<br />";
   echo '</pre>';

Used without an argument, you’ll get a nice list of all hooked functions. This will be a bit long, so you can specify a hook to narrow the list a bit. This is particularly useful when debugging or fiddling around with hook priorities. Knowing what’s hooked into wp_head() in what order is important, and this function is a great asset!

8. Automatically Add Paragraph Tags To Anything Link

WordPress does this automatically to the content and the excerpt, but there’s no reason not to use it elsewhere. The function responsible for turning double line breaks into paragraphs is wpautop()12.

$my_text = 'Welcome!
Smashing Magazine is a great place to learn new things.
I hope you’re having a nice time!';

echo wpautop( $my_text );

Sometimes you’ll want to disable this filter by default, which you can do by removing it from the content and excerpt, like so:

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

9. Send Emails Using WordPress Link

A little while back, I wrote a long article on “Creating Perfect Emails for Your WordPress Website13,” a part of which has to do with using the wp_mail() functions. These functions let you use built-in WordPress awesomeness to send emails to users.

$message = 'Hello, thanks for reading my post! I hope to see you back soon.';
wp_mail( '', 'Thanks for reading my post!', $message);

You can also send HTML content by using a filter:

add_filter ("wp_mail_content_type", "smashing_mail_content_type");
function smashing_mail_content_type() {
   return "text/html";

It came as a surprise to me about six months ago that you don’t need any plugins to pull off proper paging (i.e. not just “Previous” and “Next” links); you can do it with a native function. The paginate_links() function is a handy little thing that lets you show pagination for any type of content, not just a WordPress loop.

// Pagination for a WordPress loop
$list = new WP_Query( $query_args );
$pagination = array(
   'base'       => str_replace( 99999, '%#%', get_pagenum_link( 99999 ) ),
   'format'     => '?paged=%#%',
   'current'    => max( 1, get_query_var( 'paged' ) ),
   'total'      => $list->max_num_pages,
   'next_text'  => 'next',
   'prev_text'  => 'previous'
echo '<div class="pagination primary-links">' . paginate_links( $pagination ) . '</div>';

// Pagination for anything
$list = range(1, 100);
$items_per_page = 12;
$pagination = array(
   'base'       => get_bloginfo( 'url' ) . '/mypage/%_%',
   'format'     => '?paged=%#%',
   'current'    => $_GET['current_page'],
   'total'      => ceil( max($list) / $items_per_page ),
   'next_text'  => 'go forth',
   'prev_text'  => 'go back'
echo '<div class="pagination primary-links">' . paginate_links( $pagination ) . '</div>';

11. Upload Files With Ease Link

WordPress has a bunch of great uploading functions for everything from checking the file type to finding the uploads directory. A more obscure function is wp_upload_bits()14, which you can use to upload a file to the uploads directory.

$upload = wp_upload_bits( $_FILES['myfile']['name'], null, file_get_contents( $_FILES['myfile']['tmp_name'] ) );
echo 'Well uploaded! The path to this file is ' . $upload['file'] . ' and the url to this file is ' . $upload['url'];

12. Twitter-Like Time Display Link

This was another shock to me a while back, especially since it has been in WordPress since version 1.5! If you’d like to show viewers a relative date in a human-readable format, like “5 minutes ago” or “one month ago,” try the human_timed_diff()15 function.

$diff = human_time_diff( '2012-05-05 12:05:00', '2012-05-05 12:10:00' );
echo 'This comment was submitted ' . $diff . 'ago';

// Output: This comment was submitted 5 minutes ago

13. Log In As Any User Link

If you’re building a complex website with many roles, being able to switch between them quickly and easily would be useful. The wp_set_auth_cookie()16 lets you log the current user in based on ID.

$user_id = 4;
   wp_set_auth_cookie( $user_id );

Take great care when using this function; left unchecked, it could log every user in as user number 4. Even while testing, I target it specifically to my IP, and maybe even to a special URL string just to be sure. That said, with proper safety, it can be used as part of a custom log-in script.

14. Add Custom Profile Fields In The Admin Area Link

I can’t say that WordPress offers much in the way of profile customization in the administration area. Especially nowadays, when you want to show the Twitter and other social accounts of authors, this is a shortcoming. It can be fixed easily, though. Have a look here:

add_action( 'show_user_profile', 'smashing_profile_fields' );
add_action( 'edit_user_profile', 'smashing_profile_fields' );

function smashing_profile_fields( $user ) { 

   <h3>Social Sites</h3>

   <table class="form-table">

         <th><label for="twitter">Twitter</label></th>

            <input type="text" name="twitter" id="twitter" value="<?php echo esc_attr( get_the_author_meta( 'twitter', $user->ID ) ); ?>" /><br />
            <span class="description">Your Twitter Username</span>

         <th><label for="twitter">Facebook</label></th>

            <input type="text" name="facebook" id="facebook" value="<?php echo esc_attr( get_the_author_meta( 'facebook', $user->ID ) ); ?>" /><br />
            <span class="description">Your Facebook Profile URL</span>
         <th><label for="twitter">Linkedin</label></th>

            <input type="text" name="linkedin" id="linkedin" value="<?php echo esc_attr( get_the_author_meta( 'linkedin', $user->ID ) ); ?>" /><br />
            <span class="description">Your Linkedin Profile URL</span>


add_action( 'personal_options_update', 'smashing_save_profile_fields' );
add_action( 'edit_user_profile_update', 'smashing_save_profile_fields' );

function smashing_save_profile_fields( $user_id ) {
   if ( !current_user_can( 'edit_user', $user_id ) )
      return false;

   update_user_meta( $user_id, 'twitter', $_POST['twitter'] );
   update_user_meta( $user_id, 'facebook', $_POST['facebook'] );
   update_user_meta( $user_id, 'linkedin', $_POST['linkedin'] );

15. Sanitize URLs With Ease Link

When working with URLs, always make sure they are properly formed and don’t contain any invalid or dangerous characters. The esc_url()17 function lets you do just that.

$my_url = '';
   $url = esc_url( $my_url );

Be sure to check out all of the other escape functions. You can find a list of them at the bottom of the page that I linked to in the related section.

16. Empower Text Widgets Link

To make text widgets so much better, you can enable the use of shortcodes in them. This is a great tool for theme developers because it makes your product much more flexible for the user.

add_filter( 'widget_text', 'do_shortcode' );

17. Add Custom Post Types To The RSS Feed Link

Not being able to do this easily from the admin area is a big issue. Many website owners separate their content into custom posts, and they also want all of their items to show up in the feeds. Never fear — a function is here!

add_filter('request', 'smashing_custom_feed');
function smashing_custom_feed( $vars ) {
   if ( isset( $vars['feed'] ) ) {
      $vars['post_type'] = get_post_types();
   return $vars;

While this is great, it forces all of your post types into the feed. If you’d like to add just some of your custom post types to the feed, you can list them separately.

add_filter('request', 'smashing_custom_feed');

$post_type_list = array( 'post', 'products' );
function smashing_custom_feed( $vars ) {
   if ( isset( $vars['feed'] ) AND !isset( $vars['post_type'] ) ) {
      $vars['post_type'] = $post_type_list;
   return $vars;

18. Don’t Break WordPress Loops Link

Multiple loops are great but can wreak havoc if not used correctly. To make sure your loop runs smoothly and you can still use all of the functions that rely on globals, store the original query in a temporary variable.

$tmp_query = $wp_query;
while( have_posts() ) : the_post() 
   <a href="<?php the_permalink() ?>'><?php the_title() ?></a><br />
$wp_query = $tmp_query;

19. Custom Database Queries Link

If you need something more than what the default WordPress functions give you, you can use $wpdb18, the WordPress database class to query the database directly.

$recent_users = $wpdb->get_results( "SELECT display_name, user_registered FROM $wpdb->users ORDER BY user_registered DESC LIMIT 0,10" );

This class has great features and functions. Take a look at “Interacting With the WordPress Database19” for an in-depth tutorial.

20. Customize WordPress Post Revisions Link

The post revisions feature in WordPress is great, but the majority of users don’t use it. Database entries are created for revisions, even if they are not used. While they’re not a huge hit on your server’s performance, if you don’t use revisions, you can disable them by placing the following code in your wp-config.php file.

// To remove revisions

// To limit them
define( 'WP_POST_REVISIONS', 5 );

20. Styling Author Comments Link

If you’d like author comments to jump out, simply use the bypostauthor class in your CSS.

li.bypostauthor {

21. Storing Your Whole Page In A Variable Link

In some cases, storing your whole output in a variable can be very helpful. This allows you to make global changes, compress or obfuscate code and more very easily. All we need is PHP output buffering and two hooks.

add_action('wp_head', 'smashing_buffer_start');
add_action('wp_footer', 'smashing_buffer_end');

function smashing_buffer_start() {
   ob_start( 'smashing_callback' );

function buffer_end() {

function smashing_callback( $content ) {
   // Feel free to do things to the content here
   $content = str_replace( 'great', 'awesome', $content );
   echo $content;

And The List Goes On Link

Do you have any favorite WordPress tips and tricks or best practices that you wish were followed more? Please do share in the comments so that we can all learn something new!

(al) (ea)

Footnotes Link

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19

↑ Back to top Tweet itShare on Facebook

Hallo, my name is Daniel :) I build plugins, themes and apps - then proceed to write or talk about them. I contribute to various other online sites. When not coding or writing you'll find me playing board games or running with my dog. Drop me a line on Twitter or visit my personal website.

  1. 1

    As I said in my other comment: Many thanks for the article! And I know this is not a forum or a place to demand anything, but maybe someone has some info an a topic regarding WordPress:

    How does one create a loop that ALLOWS duplicates? My research so far leaves me still in the dark on this topic.

    Feel free to delete this comment if you think its way out of scope!

    • 2

      Hi Ulrich,

      What do you mean by duplicates? I’ll be happy to give you some help with this if you let me know what you mean :)


      • 3

        Hi Daniel,
        with duplicates i mean, duplicate posts/IDs in the loop. Lets say i have a query like this:

        add_filter( ‘posts_orderby’, ‘my_posts_orderby_date’, 10, 2 );
        function my_posts_orderby_date( $orderby, $query ) {
        global $wpdb;
        return ” CAST( $wpdb->postmeta.meta_value AS DATE ) ” . $query->get( ‘order’ );

        $args = array(
        ‘post_type’ => ‘event’,
        ‘meta_query’ => array(
        ‘relation’ => ‘OR’,
        ‘key’ => ‘_date0’,
        ‘key’ => ‘_date1’,
        ‘order’ => ‘ASC’,
        $my_query = new WP_Query( $args );

        In my case, WordPress always removes duplicate IDs from the loop, so that no post is shown multiple times in the loop.
        I’m at a los here and have to admit that my knowledge of PHP/wordPress is limited (as you may see in my code example anyways ;)

        • 4

          Ah, I meant more like why you would want posts to be in the loop twice so I can figure out what the best solution would be :)

          • 5

            Oh sorry ;)
            the reason for this is rather simple:

            Lets say i have serveral metaboxes (dates) for a post, now i want a loop that lists the posts sorted by the metaboxes. If a post has several dates added, it should also appear several times in the loop.
            That way, you don’t need to add several posts with the same content just to have it appear multiple times in a loop.

          • 6

            Get the posts by the metabox, not the id. Now you don’t have conflict.

          • 7

            As Nathan says, the best way to go about this would probably be to get the post IDs from the meta boxes and loop through the results.

  2. 8

    I hate WordPress! Yii Rulez!!!

  3. 9

    #21 should be:

    function smashing_buffer_end() {

  4. 10

    ProTip: Never use WordPress.

  5. 12

    Good tips an tricks, but the paragraph ’18. Don’t Break WordPress Loops’, the right way is to use the ‘wp_reset_query’ function :)

    • 13

      I don’t want to be pedantic, but according to Coredev Andrew Nacin, using query_posts is evil ;)
      One should always use WP_Query. Heres a link to a talk he gave called “You don’t know query”:

      That is to say, that i really liked the article! Some good advise/tips/tricks… Thanks!

      • 14

        I absolutely agree with you, I hate query posts as it just makes no sense when WP_Query is there. However, for a lot of beginners query_posts is much easier and unless you have a sizable website it really won’t make a difference performance wise I think :)

        Thanks for the kind words and the correction, I should have mentioned this in the article itself :)

        • 15

          You should never teach something because it’s easier to use when you know it’s wrong. This example should use WP_Query() and ending with wp_reset_postdata() as mentioned on

          • 16

            Marko… And yet we teach Newtonian physics, even though strictly speaking “it’s wrong”. Teaching something even tho it may not be entirely correct should not be ruled out. If by teaching it “right” you drive novices away to less reliable sources you are doing more harm than good. I would argue the best approach in this instance is to teach it “wrong” but to explain that there is a better, but more difficult, way to do things. This will result in the retention of readers, and when they are successful implementing the “wrong” but easier approach, will also raise their confidence in this site and themselves, thus making them more likely to come back to learn about the better approach that you advocate. This will eventually lead to more people doing things the better way – good news for everyone surely?

        • 17

          I agree; query_posts as a viable solution for creating a query is bad practice and should not be encouraged.

      • 18

        But don’t forget about get_posts which is very useful for newbies but is also (I found personally) a lot faster, especially for large sites. I might however be wrong :D

    • 19

      And don’t use query_posts. Never. It’s evil. Just use pre_get_posts.

      More info about that, in Nacin’s talk:

      • 20

        It all depends on who is using it and what you’re using it for. I agree that pre_get_posts is the best solution if you know what you’re doing. There isn’t much difference between query_posts and WP_Query if you’re using it for the same thing since they make the original query redundant either way.

        pre_get_posts() is the way to go but its use is for more advanced users. query_posts is not evil because it does pave the way for beginners to understanding how queries work. For more advanced users it is a definite no-no, but everything has its place.

  6. 21

    Patrick Samphire

    September 26, 2013 2:26 am

    Regarding #3, this is fine if you’re only using the image at its uploaded size. Then you can upload an optimised image with jpeg_quality set to 100%. However, if you let WordPress create a bunch of images with different dimensions from this uploaded image (for example, if you’re using them for different breakpoints in responsive design), then you’ll find that a quality of 100% produces images with very large file sizes, because the resized images will not be optimised themselves.

    You can actually get the situation where an image of smaller dimensions can have twice the files size of the original, which is massively counterproductive for responsive design.

    You’ll need to play around with settings for your own images, but I’ve found 85% is a pretty good compromise.

    • 22

      Christopher Ruggia

      September 26, 2013 6:47 am

      I have often wondered about image compression in WordPress. Image files add tremendously to page bloat, and proper image optimization is often touted as the first priority for increased page speed.

      With this being the case, it is surprising that WordPress doesn’t have more robust native controls for managing image optimization. In fact, it seems that if we do go to the effort to optimize our images using a decent utility for the purpose, WordPress will undermine that effort on upload by chunking out a bunch of barely compressed copies at the different specified image sizes.

      It would seem to just make that problem worse by telling WordPress not to compress our images at all with a 100% quality setting.

      I would be very interested in seeing some work done toward more granular compression control via plugins, etc., as my development chops aren’t quite up the task yet.

      • 23

        The reason I myself remove the compression altogether is that we sell themes and we need the highest possible image quality. We do optimize our images ourselves and we really don’t want WordPress to modify things.

        • 24

          Patrick Samphire

          September 28, 2013 1:09 am

          Except that if you allow WordPress to alter the dimensions of the image at all, you’ll end up with images that are not optimised. Like I said, if you don’t allow WordPress to alter the dimensions of images you display, that’s fine, but in the vast majority of cases, it’s going to cause problems.

          Christopher is right that WordPress needs better controls for image optimisation, particularly with responsive design requirements becoming ever more important.

  7. 25


    Good post, what about doing a tutorial on how to use/setup/develop wordpress as a members site ?


  8. 26

    “Mark J. Aquith”? LOL
    Also, for number 13 (Log in as any user), it would be much safer to use the User Switching function in Automattic’s own Developer plugin:

  9. 28

    wp_register_script( $handle, $src, $deps, $ver, $in_footer );

    $in_footer = true allows you to append your script tag to the body instead the head. Default is false.

  10. 29

    Jeremy Abrahams

    September 26, 2013 3:10 am

    #14 has the twitter post var duplicated when setting the facebook and linkedin vars.

    update_user_meta( $user_id, ‘twitter’, $_POST[‘twitter’] );
    update_user_meta( $user_id, ‘facebook’, $_POST[‘twitter’] );
    update_user_meta( $user_id, ‘linkedin’, $_POST[‘twitter’] );

  11. 31

    The code in “11. Upload Files With Ease” isn’t the best way of doing $_FILES upload. wp_upload_bits(). WordPress only using that for the XML-RPC and inside the function wp_generate_attachment_metadata().

    For dealing with file uploads you should use wp_handle_upload(). That does some extra checking since wp_upload_bits() has some flaws. See

    You can also use media_handle_upload() depending on the need of the user. Makes things easier then using wp_upload_bits() or wp_handly_upload() since you still need to add the image to WordPress.

  12. 32

    love this tips.awesome !

  13. 33

    Some really usefull tips.

    Thanks for share !!

  14. 34

    Aurélien Denis

    September 26, 2013 4:02 am

    Awesome list! Just one thing for #3 : you need a recent version of PHP to get it.

  15. 35

    Wow Really Helpful list. Thank you for posting. :)

  16. 36

    There’s an error in tip #14…

    The last bit of the code should be:
    update_user_meta( $user_id, ‘twitter’, $_POST[‘twitter’] );
    update_user_meta( $user_id, ‘facebook’, $_POST[‘facebook’] );
    update_user_meta( $user_id, ‘linkedin’, $_POST[‘linkedin’] );

    Hope that fixes the issue for everyone.

  17. 37

    Great article and thanks for the tips. You know there’s actually 22, right? You repeated the number 20 twice ;-)

  18. 38

    Great tips and tricks collection, Daniel. Found one yet, to force wordpress to use relative paths for moving from test sites to live sites easier?

    • 39

      Steven – are you not using relative paths in your code? After moving from one environment to another we run the following two queries in mySQL:

      update wp_options set option_value=’’ where option_name = ‘home’;

      update wp_options set option_value=’’ where option_name = ‘siteurl’;

  19. 40

    This is brilliant, a very helpful read!

    Thanks Daniel

  20. 41

    … thank you! This will really come in handy on my projects

  21. 42

    Jonathan de Jong

    September 26, 2013 9:59 am

    Great list :) Some of them was new to me and I especially got excited by the filter to add shortcodes to textwidgets.. I’ve previously used enhanced text widget plugins, well no more!

    Thought I’d share a nice little snippet which allows you to change the default “Enter title here” text in the title field of a post/page/cpt. A nice feature when using CPT for say events and to be able to set it to “Enter event name here”.

    function change_default_title( $title ){
    $screen = get_current_screen();

    if ( '_your_custom_post_type_' == $screen->post_type ) {
    $title = 'The new title';

    return $title;

    add_filter( 'enter_title_here', 'change_default_title' );

  22. 43

    Okay, you got me on human_time_diff(). Never even occurred to me to check for a function like that. Thanks!

  23. 45

    Nice list! And here is one tip from me:
    I really love shortcodes. And i use really complex shortcodes. The problem is, that you only can return values in a shortcodes. With this snippet you can write your codes with echos and you can call functions etc…

    function my_shortcode($atts, $content = null) {

    // Start of output

    echo some_function();
    echo ‘some html’;

    // End of output

    $output_string = ob_get_contents();
    return $output_string;
    add_shortcode(‘my_shortcode’, ‘my_shortcode’);

    • 46

      Chris Reynolds

      March 19, 2014 1:19 am

      You could also change|:

      $output_string = ob_get_contents();


      return $output_string;


      return ob_get_clean(); // This function does both ob_get_contents() and ob_end_clean().

  24. 47

    Amazing! This is one for the bookmarks, nice work!

    May I suggest to write a post about “Powerful WordPress SQL Queries”. Topics like… Change Site URL, Home URL, GUID, URL in content and most importantly Change admin username and even generate new password. Clearing data like unused tags, pingbacks, spam comments, revisions. Even a trick to export all comment emails without duplicates ;)

    Thanks for reading, if anyone else has some suggestions on this please chime in.

  25. 48

    FYI: You have two “#20” items!

    One tip I would have, in general and above all else, is to keep WordPress secure! An older version of WordPress, an outdated plugin, or some other type of gaping hole/security hazard is something you absolutely want to avoid. It sucks when that happens, and it could make all these cool, advanced-level tips moot.

    So always keep backups (and automate them, if you can, to save time), and always make sure your sites are updated. ManageWP, does all of these things, but there are also individual plugins like BackupBuddy, VaultPress, and other plugins work this magic.

    Thanks for the great post!

  26. 49

    Here’s a snippet that will disable the default behaviour whereby the list of checkbox items in the Add/Edit Post ‘Categories’ box are reordered to show the selected categories first. This code will respect the original parent/child hierarchy of the categories. Add to your theme’s functions.php file:

    function taxonomy_checklist_checked_ontop_filter($args) {
    $args['checked_ontop'] = false;
    return $args;

    add_filter("wp_terms_checklist_args", "taxonomy_checklist_checked_ontop_filter");

  27. 50

    WOW, most awesome pro tips! Very useful, it’s a lot of very good tweaks to do without installing plugins!

  28. 51

    In your article numbering you listed #20 twice.

  29. 52


    October 21, 2013 3:22 am

    Great article Daniel, WordPress in every update adds many tricks, and some of it wouldn’t be archived on the codex, so the developer need just to focus on the core, analyse the changes and he’ll surely get what he’s looking for. especially when you’re looking for something extra, colorpickers, advanced upload, advanced croping system, crons .. etc.
    Again, Thanks Daniel

  30. 53

    This is an awesome post, it was worth it just for the main wordpress built in script links you posted. I didn’t know it would be so easy to do some of that shit.. Thanks for this post.

  31. 54

    virendra kumar

    November 8, 2013 11:14 pm

    This is very helpful Thanks!!!

  32. 55

    Many thanks! human_time_diff() – it’s awesome

  33. 56

    thanks for your tutorial. but i have a problem with my cart
    i want use ajax with wordpress in cart but i don’t know how to. help with me , plz

  34. 57

    These tips are very useful… Also, just an update.. According to the WordPress Codex, the jpeg_quality filter from tip #3 (Force Perfect JPG Images) is now deprecated. If you want to force perfect images in WP, you should now use wp_editor_set_quality. Hope this helps!

  35. 58

    Very useful information. I’m still somewhat of a newbie at WordPress, so I thank you for the suggestions.

  36. 59


    July 12, 2014 11:39 am

    Such a nice info.Thanks for share this.
    Rehman Ali

  37. 60

    As for tip #14, some themes have that built it, but it isn’t always to the exact social media feeds you want. I appreciate the tip on how to customize it myself.

  38. 61
  39. 62

    Great job, thank you very much. I am working on amazing web also.


↑ Back to top