Why Are Developers Obsessed with Custom Code in WordPress?

[ad_1]

Hey everyone,

I've noticed a trend in various dev communities where there's a strong emphasis on writing custom code for WordPress, even when using pre-built themes and plugins might be sufficient. I understand that custom code can be necessary for unique functionalities or design elements, but why is there such a push for custom themes for nearly every project?

Isn’t one of the main advantages of WordPress its ability to speed up development and help deliver sites quickly? If we're still writing a lot of custom code, does it undermine the benefits of using a platform like WordPress? I get that plugins can add bloat, but isn’t it possible to optimize performance by following best practices?

Looking forward to hearing your thoughts and experiences on this!

[ad_2]
31 Comments
  1. A few lines of custom code in functions.php are preferable to a bloated plugin with ads, nag screens and telemetry.

  2. Your own code -> much more efficiency and speed website. For sure if you know what you do.

  3. Those of us who advocate for custom code are typically agency developers who have to build websites to match the designs delivered to us. The only way to do that is to write our own themes.

  4. Its completely dependent on the situation. Does it make sense to handwrite every line of html and every line of CSS? Absolutely not. A clean code page builder like Bricks is the way to go.

    If you need let’s say one instance of a small css animation, does it make sense to download a plugin for it? Absolutely not. An entire plugin is way too much bloat and space for something that can be done by hand so easily.

    Its your job as a developer to understand the use cases, the how and why, etc.

    If you never spend time learning how things work at a deeper level, then you’ll need a plugin for absolutely everything. That’s not an ideal way to build a site.

    And if you have this weird rule in your head where absolutely everything has to be hand coded, you’ll spend an absurd amount of time on even the smallest projects. Also not ideal.

  5. It could be argued that without custom code, you are a WordPress power user, not a developer.

  6. Most of it’s been covered here, I use generatepress for sites.
    Do I want a plugin for filters, a plugin for sliders, a plugin for countdowns?
    I have these already coded in my arsenal and know that the code loads when the block or shortcode is used.
    When speed is everything for a client, I’m in control of what loads and when.

  7. I built our club web site in a day and then added some functionality using php. I dont know if there is a plug in that does it but I needed to enumerate a folder and format and display the contents so that people could download a newsletter from the archive and I also needed to format and display a .csv file for membership info. I used a free plugin to integrate the php.

  8. Why do you need developers to build websites using pre-built themes and plugins? That’s like asking a chef at a restaurant to just order takeout from another restaurant to serve their guests.

  9. When I first started making WordPress websites, I would piece together countless free plugins / themes to get the desired result, and what I got was a bloated mess that didn’t matter how much hosting resource I threw at it, it still was sluggish. Obviously a lot of plugins serve their purpose, but a lot of them are also designed for people that don’t know how to implement code on their own.

    Find a lightweight fully customizable theme (I use GeneratePress) and then use your best judgment on what functionality really requires a plugin. If it is something simple, you are much better off handling it yourself.

  10. If I run into an error with a third-party plugin or theme I need to submit a support request to their support to get the issue fixed. There is no telling how long that will take to get fixed, if it ever gets fixed. I have several outstanding issues that have never been acknowledged or slated for a future release and have never been released.

  11. There’s a lot of reasons why developers prefer custom builds over prebuilt themes and plugins. Just to name a few: tailored design and branding, optimized performance, speed, efficient code, security, custom functionality and integration via apis, better control over seo, scalability, flexibility and maintainability, avoid theme limitations, cheaper

  12. It really depends from a project to project. If there is great solution in a plugin which can cover several “tasks” and it would take me days/weeks to develop and test the same with custom code, I don’t see many reasons why not to go with it. I think the best solution here is not extreme. I usually find it as combination of both.

  13. Even with a fully custom theme, WordPress still makes development faster.

    You have things like: user management, REST api, database, build, plug in capabilities, etc. And it’s open source and incredibly well-documented and supported.

    Just the fact that you can log in and change a theme right at WordPress install is a bunch of features that would otherwise be built from scratch.

  14. I think it because if you are not using templates and page builders (which most devs prefer not to for good reason) your choices are pretty much custom code or Gutenberg.

  15. Every project is different, and besides disposable websites, you might need a specific item that it is not available on a theme.

    And most themes are bloated with unnecessary things.

  16. Now that’s just my personal experience, but for me custom code is faster, lighter, safer and does exactly what I need, noting more, nothing less. Let’s break it:

    ## Faster
    Here it’s completely related to my own experience and might not be the case for everyone, but I’m much, much faster at building things from code than installing themes and plugins and configure, tweak and bend everything in place so that it looks like what I’m supposed to build. From working on the mockups I know exactly the structure I’ll have to build, know which parts will be reusable, what will blocks, what will be hard coded, what will dynamic and what will be static.

    ## Lighter
    I code what I need, I don’t have to install an unknown number of plugins that all include dozens of features and scripts and settings I’ll never use. My themes and plugins do what they’re meant to do, period.

    ## Safer
    My code is my own. I know what I do, I know what the weak points are, where the security threats can be found. I don’t have to monitor and update dozens of themes and plugins to make sure I don’t get hacked.

  17. over the past 15 or so years we as an agency have built a lot of WP sites using a lot of plugins and custom code to achieve the goal.
    over time we put together a set of plugins and a theme we were happy with which meant we could quickly prototype pretty much anything.

    if there was functionality outside of the norm we would see if it could fit into an ACF setup or we would custom code it.

    unless there was a specific plugin that we had previously used and trusted to do the thing. then we used that.

    However, and its a fairly big however.

    If i were to go back in time i would use less plugins than i do now. i would have custom coded more functionality. specifically around page builders and their addons. The main reason for that is plugins getting abandoned and / or bought out and changing the goal posts.

    we always kept the plugins we used to a minimum. and made use of plugins like code snippets to add functionality that should be two lines of code and not a plugin. like turning off xmlrpc or things like that.

    but it is about efficiency versus risk really.

    we pride ourselves on our approach of not locking you into anything as a client. so we can build a site and you can run with it yourself or take it to anyone else fluent in WP and you are good to go.

    And lets face it when a site is created with all the functionality in theme overrides then most “WP devs” wont know where to start. because they aren’t devs they are power users as /u/likeableNymph said below.

    However back the other way, the argument you see the most for custom code is “i had to to achieve what the client wanted” and perhaps some of the time thats true. but rarely.

    I have had one instance in the past 5 years or so where a client design couldnt be made with the base theme we use for all sites. and that was down to them specifically wanting a mobile header layout that was not catered for. so we wrote the code to do that within the theme and now it does.

    Most of the good themes have the flexibility to tailor for almost any design.

    Anyone can use The7 theme to create essentially any layout look and feel you want. and it would take a fraction of the time to complete plus would be much more future proof compared to a custom built theme that just does what the client wants.

    I think this is really down to what i believe is right by the client.

    Add a theme onto a site and if they decide to use woocommerce in 6 months then it just works.

    or make a barebones just enough theme manually and then charge them more in 6 monthts to add all the woocommerce styling plus any extras for filters or whatever other features they want.

    and speaking of woocommerce. what is the point at which you dont do custom code anymore?

    If they want ecommerce would you use WC? or would you custom code that?

    i believe most people would use WC because of the amount of work required to replicate it and all of its supporting payment plugins, shipping plugins etc etc.

    So there is a good enough / line in the sand being drawn at which point plugins are ok to use.

    back to the top. we drew this line in the sand and have been using our set of plugins and theme since then. we shouldnt have used some page builder addons and given the choice i would go back and never use them as it caused a ballache when they went awol and then disappeared. but other than that its been going well.

  18. Because… that’s what developers do? We develop code to make our websites do what we want them to do and look how we want them to look. If I get a mockup from a client or designer, the odds that I can find an identical pre-built theme are pretty slim.

  19. Because wordpress offers a wide variety of things that are plug and play ready so to say but usually a design has the smallest thing that cant be done with those elements.

    So a seasoned dev will usually just write custom code to avoid the frustration of jumping through hoops to get a solution that isnt like the intended design.

    Last year i helped out a dev who had similar issues where he couldnt match the design and the designer was getting quite annoyed. So the first element was frustrating as i was trying to use the plugins and stuff he had used to make the design and ended up using custom code. The issues after that i immediately resolved with custom code, sparing me the frustration

  20. I’ve have been burnt a couple of times from a theme or plugin that gets abandoned by the author or updated with some unwanted garbage features.

    But the biggest reason for me is that so many plugins are not free in the WordPress ecosystem (and don’t get me started on the subscription model that most employ). If you can figure out a way to accomplish the same task in your own code, you can keep costs way down.

  21. I’d think of it like this.

    If you’re making a sandwich, you can go out and buy one of those triangle sandwiches that comes in a cardboard box from a store. It’s quick, simple, and definitely ‘a sandwich’ in the strictest terms. It’ll even do you for lunch. Perfectly fine. Nothing wrong with it. Totally edible. Really it’s all that you need.

    Or you go and get a sandwich from a restaurant. It’s got all the fine ingredients, some garnish, it looks beautiful on the plate, maybe it’s been heated up or has the bread lightly toasted. It tastes delicious. It’s been hand crafted by a professional to make it the best it possibly could be.

    That’s the difference between sticking a theme on and having someone use custom coding to polish it.

    When I first started with WordPress, I got by with slapping a theme on and working in a few plugins. It did the job but would often fall apart visually on a few devices or particular screen sizes.

    As soon as I took the time to learn how to do some basic custom css and work in some personalised code it absolutely takes it to the next level.

    The website goes from being functional and shoddily put together to something that looks professional and cared for, which if you’re using it for business will give your customers confidence in your product.

    How many times have you clicked on a poorly built website and thought twice about buying from it? I don’t want to put my card details into something I don’t trust, and a website being well made is a big step towards achieving that trust.

    Custom code is what gets you to that point imo.

  22. I don’t need to pay for someone else’s shitty plug-in. I can write my own shitty plug-in.

  23. Here’s a custom-code example. On a Woo store selling folk music CDs and sheet music, we needed two “out of stock” categories. One was for stuff we could re-order from the publisher, and another was for out-of-print stuff. I couldn’t find a plugin to do this precise thing, so I wrote a snippet of about 40 lines of code to change the “out of stock” message to “ out of print “ for products with that tag. Then we use the Out Of Stock Notifications plugin to let our customers ask us to re-order out of stock stuff.

    I’m sure most sites have similar fine-tuning tweaks they need.

  24. It’s really mediocre developers that just learned to make a custom template and who bank off Figma to WP projects. Senior devs understand you have to know when to extend plugins vs build totally custom plugins/thenes. As well
    As when and how to support/extend the page builders.

  25. Where do you think the plug-ins come from in the first place? /jk

    WordPress is as much a platform as it is a simple easy to use website creation tool. The sheer range of uses to which WordPress is put shows how versatile it is and how awesome the plugin driven system allows it to be.

  26. The short answer is that while there’s a perfectly good subreddit for professional full-stack WordPress programers (/r/ProWordPress) most WP programmers (like ordinary WordPress users and less-technical WordPress professionals) tend to congregate here.

    And programmers don’t get paid unless they can write custom code.

    If I was one of the mod for this subreddit I’d probably spend more time promoting /r/ProWordPress for, you know, WordPress Pros. Because while there are something on the order of a million WordPress sites have been custom coded, the other 299,000,000 WordPress site *weren’t* custom coded. With the result that their owners and users tend to get iced out. As do too many beginning users, graphic designers, no-code and Genesis-style “code monkey” site builders.

    Again, I think programmers would be very happy over at r/ProWordPress. Even better, when someone dropped in with common newbie questions about WordPress they could quickly refer them here. Where they might not feel as squeezed out by pros.

    Anyway, I’ve been thinking about saying something about it for weeks. This feels like the right thread to bring it up.

  27. * I know how to extend it, typically much more easily, later. WP plugin developers aren’t always great about letting things get extended or documenting how they can be extended.
    * I know exactly what’s in it and don’t have to slog through other people’s garbage to debug, only my own familiar and comfortable garbage.
    * I know it won’t randomly be rewritten and changed out of nowhere, forcing extra work on me later.
    * I know it won’t be deprecated or removed from the plugin repo at random, or have features that were free locked behind pro versions.
    * I’m not subjected to lots of extra needless gunk. Actually kind of rare to find a really good, really simple plugin that does a thing and gets out of the way.
    * Code is often fun, clicking buttons to configure plugins is often not.

    Am I gonna write custom search filtering, or custom forms? No, not when FacetWP and Gravity Forms exist and are both extremely flexible and extensible and well-documented, robust, long-lived plugins.

    Am I gonna lean on some random plugin to implement a table of contents that has to (for some inexplicable client reason) be a `div` on desktop, and a `select` on mobile? No, that seems like pain and more work to use a plugin vs ~60 lines of JS.

    Is there a plugin out there that can fix a bunch of orphaned comments that were imported from another system and aren’t associated with the posts anymore? Very unlikely, and if it does exist it’s not going to run as well over the 60K orphan comments as a couple of WPCLI commands with direct database fiddling.

    Some plugins make sense sometimes, and not other times. E.g., User Role Editor for very basic post type permissions and a few custom roles — why, when roles are easy to define and easy to do basic permissions? Makes more sense if the roles are constantly changing or need to be client-editable.

    tl;dr: it really depends.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer