Technology

9 common mistakes developers make in WordPress

Posted by Pixafy Team

Common WordPress mistakes

Having done dozens of projects on the WordPress platform, we’ve learned a lot along the way about best practices from which others could benefit.  Here are tips, culled from our team, of common mistakes to avoid when developing in WordPress:

1. Attempting to code things that are actually native WP functionality.  This requires you to know the platform. As such, practice, either on your own site, building generic themes, etc., which can go a long way to building confidence in knowing WP.

2. Not checking your dates.  Lots of lost time can be lost on old tutorials that are out of date and therefore inaccurate; putting a floor on how far back you consider a tutorial as valid will help toss out bad tutorials and suggestions.  Using Google’s date range feature can help further with that. You can look at the version history of WordPress to see what version would have been current at the time the tutorial was written, and you can see the changes each version since then brought.

3. Knowing when a plugin will make life simpler. As an example custom fields can add additional editable values in a particular post or post type, but sometimes it helps to employ bigger guns, such as Magic Fields, to make the process easier on the end user.  WordPress has a substantial plugin library from which to tap.  That said…

4. Not doing enough homework about plugins.  If you put two plugins that don’t like each other together and it can break things. Poorly coded or implemented plugins can cause the site itself to perform more slowly.  Picking lightweight plugins, or plugins you have experience/reliability with, can not only speed development but also provide more confidence in what you’re building.

5. Incorrectly building out a theme’s parameters. Forgetting to re-name the theme, complete with screenshot and descriptions/tags, can make the template itself look sloppy.  There’s a place in the CSS file to define those values, and a way to specify a screenshot that represents the the theme.

6. Carving pages using classes that are different from wordpress native classes. Keeping the WordPress structure in mind can save a lot of time with CSS later.

7. Making templates/functionality that depend on Post/Page IDs, which can change depending on the site and the contents of the database.

8. Hardcoding images/links instead of taking advantage of site URL or similar functions that will prevent URLs from breaking if the site is moved. Examples include:

<?php echo site_url(); ?>

or

<?php bloginfo('template_url'); ?>

To get paths based on the database configurations.

9. Forgetting to style potentially less common pages, such as the 404 page, search results page, or even the image gallery page (which comes up when you click on a link surrounding a picture, when set in WordPress).

What are some other mistakes developers make in WordPress? Share with us below or tweet us @Pixafy