Speckyboy RSS: How a Custom WordPress Plugin Can Help You Manage a Website

Your latest Speckyboy content is here!.

Speckyboy Design Magazine

Design News, Resources & Inspiration

How a Custom WordPress Plugin Can Help You Manage a Website


By Eric Karkovack on Mar 28, 2021 05:08 pm


Whether you’re a WordPress user or build websites for a living, it’s likely you’ve relied on a few plugins along the way. These additional pieces of software enable the content management system (CMS) to perform new and exciting functions. Everything from contact forms, shopping carts to SEO are just a few clicks away.

Even better is that it’s possible to build your own custom WordPress plugin. And, no, it doesn’t have to be anywhere near the scale or depth of big players like WooCommerce or Jetpack. Nor do you have to be an expert in PHP or JavaScript (though some working knowledge helps).

In fact, some of the best reasons to build a custom WordPress plugin aren’t about adding major functionality. They’re more about making your website easier to maintain over the long term. Things that will save you from problems when you switch to a new theme or hand off a site to a client.

That’s only scratching the surface of what a custom plugin can do. To help demonstrate their power and convenience, here are some situations where building a custom WordPress plugin can be a big help.

How Do You Build a WordPress Plugin?

Before we get into the scenarios of why a custom WordPress plugin could make sense for your project, you may be wondering how to go about building one. That’s a pretty deep subject.

There are tons of reference materials and tutorials out there that cover the specifics. Therefore, we won’t go into great depth here.

Instead, we’re going to point you to the WordPress Plugin Handbook – which is the best place to start. It provides all the background information you need to get your project moving forward. In particular, check out the Plugin Basics section, as it will show you the required first steps.

It’s also worth checking out the Hello Dolly plugin that’s included with a default WordPress installation. The entire plugin is contained within a single PHP file. Its simple structure could serve as an inspiration for your own creation.

In addition, you will want to check out the following resources for getting the most out of your custom plugins:

The WordPress Plugin Handbook home page.

Scenario #1: Making Customizations That Survive a Theme Change

So often, WordPress code tutorials mention that you can add a snippet to your active theme’s functions.php file. Why? Because it’s often the easiest path forward for both the writer and the reader.

That doesn’t make it the best solution, however. Think, for example, of a custom WooCommerce hook that displays some text at the bottom of every product page. This little bit of code will work just fine while residing in your theme – but what happens after a redesign?

Switching themes means losing that customization – unless you remember to copy it over to your new one. A more likely scenario is forgetting about that snippet and scrambling to put it into your new theme after you realize it’s missing.

A plugin removes this potential issue because it’s completely separate from your theme. You can switch themes to your heart’s content and that functionality will still be there.

WordPress Themes page.

Scenario #2: When Functionality Has to Travel Between Websites

Building WordPress websites usually means that you’ll eventually need to use the same functionality in multiple places. That could be adding customer support info to each site you manage or even sharing custom post types across a multisite installation.

With the advent of the Gutenberg block editor, custom blocks are also a prime use case. While some blocks may be client-specific, others could be more general purpose. Placing your blocks into a plugin makes them highly portable.

A custom plugin can be a lifesaver in these situations. You don’t have to reinvent the wheel over and over. Instead, the functionality you need is included in a single package. Just install, activate and move on.

However, this is a good time to bring up the subject of plugin maintenance. If you utilize the same custom plugin on multiple websites, you’ll need to have an effective way to update the code when needed. Version control systems such as Git can come in handy for this task.

While that’s a subject for another day, it’s important to think about before you install your plugin on multiple websites. The more places a plugin resides, the harder it is to maintain without some form of automation.

A collection of suitcases.

Scenario #3: Enhancing an Existing Plugin

Many WordPress plugins offer support for various hooks and filters – code that allows you to change or expand its output and functionality. Think of the WooCommerce example mentioned above as one potential use.

These customizations can play a vital role in how specialized projects such as eCommerce or membership sites work. Placing them into a custom plugin can help in a number of ways.

Beyond the aforementioned separation from your theme, a custom plugin will also allow for better organization. Having all of your code snippets in a single spot means never having to search around for them when it’s time for a change.

Then there’s the ability to add on new functionality down the road. As your website evolves, you may want to build further enhancements. Add them to your custom plugin rather than hacking away at your theme.

Of course, there are also times when a trusted third-party plugin is no longer a viable option. Whatever the reason, you can easily deactivate your custom plugin or remove the additional code you wrote when that time comes.

A electrial plug near an outlet.

A Well-Organized Way to Add Functionality

Before you add custom code directly to your WordPress theme, think about its purpose. While it’s a good place for theme-specific items, other types of functionality really don’t belong in your functions.php file.

For everything else, a custom plugin is the better option. It provides a separate space to store vital functions while keeping them well-organized. You’ll even be able to switch to a new theme without losing your hard work.

The result is a website that is easier to maintain, along with functionality that can be quickly replicated for use elsewhere. It’s a great way to level up your WordPress development workflow.

The post How a Custom WordPress Plugin Can Help You Manage a Website appeared first on Speckyboy Design Magazine.



Read in browser »

Recent Articles:

Weekly News for Designers № 585
Waking Up the Taste Buds of Your Design Clients
Are Google’s Core Web Vitals Metrics Unreasonable?
8 Common Website Layouts Built with CSS Grid
Weekly News for Designers № 584
Share
Tweet
+1
Share
Forward
Copyright © 2021 Speckyboy Design Magazine, All rights reserved.
You signed up for daily Speckyboy Design Magazine email alerts either via Feedburner or directly through our site.

Our mailing address is:
Speckyboy Design Magazine
27 Braeside Park
Inverness, Scotland IV2 7HL
United Kingdom

Add us to your address book


Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list.

Older messages

Speckyboy RSS: Weekly News for Designers № 585

Friday, March 26, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Weekly News for Designers № 585 By Speckyboy on Mar 26, 2021 10:48 am Envato Elements 100

Speckyboy RSS: Waking Up the Taste Buds of Your Design Clients

Wednesday, March 24, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Waking Up the Taste Buds of Your Design Clients By Addison Duvall on Mar 24, 2021 07:18 am One

Speckyboy RSS: Are Google’s Core Web Vitals Metrics Unreasonable?

Tuesday, March 23, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Are Google's Core Web Vitals Metrics Unreasonable? By Eric Karkovack on Mar 23, 2021 08:15

Speckyboy RSS: 8 Common Website Layouts Built with CSS Grid

Monday, March 22, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration 8 Common Website Layouts Built with CSS Grid By Eric Karkovack on Mar 21, 2021 05:42 pm Among

Speckyboy RSS: Weekly News for Designers № 584

Saturday, March 20, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Weekly News for Designers № 584 By Speckyboy on Mar 19, 2021 07:43 pm Envato Elements The 20

You Might Also Like

Celeb Homes at the Holidays—and a Few More Things to Make You Merry

Tuesday, December 24, 2024

View in your browser | Update your preferences ADPro Holiday Cheer Whether your taste leans traditional, modern, or all-out extravagant, AD is rife with inspiration for your holiday. In the spirit of

#488: Fun And Useful Gems

Tuesday, December 24, 2024

Radio garden, Zoom backgrounds, visual history of the alphabet and fun interactive experiences. Issue #488 • Dec 24, 2024 • View in the browser Smashing Newsletter Hello Smashing Friends, As we are

Accessibility Weekly #428: Putting AI to the (Accessibility) Test

Monday, December 23, 2024

December 23, 2024 • Issue #428 View this issue online or browse the full issue archive. Hey accessibility friends! It's the time of year where news and information slows down as many people take

2024 magic moments

Sunday, December 22, 2024

Issue 225: The year from my personal lens ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Planning mode

Friday, December 20, 2024

Lessons from our first-ever annual planning sprint ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

We Co-Sign This AD100-Approved Trend

Thursday, December 19, 2024

View in your browser | Update your preferences ADPro Emboldening the Bath Marble, marble, everywhere, and every drop is chic. According to AD100 designer Jake Arnold, “material drenching”—that is,

177 / Keep calm by listening to these ambient sounds

Thursday, December 19, 2024

Product Disrupt Logo Product Disrupt Half-Monthly Dec 2024 • Part 1 View in browser Welcome to Issue 177 Lately, I've been driving a lot of inspiration from the things I see in real life. The range

The Year in Color: Hella Jongerius, Mocha Mousse, and More

Thursday, December 19, 2024

View in your browser | Update your preferences ADPro Color Our World Since the summer, AD PRO has kept its finger on the pulse of color predictions. Overall, the vibe right now is down to earth,

🐺Get Media Features in 2025

Thursday, December 19, 2024

A BIG Wolf Craft announcement!! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Small teams

Thursday, December 19, 2024

Issue 224: Why the mentality of lean and small always wins ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏