The CW Corner – Stop Wasting Time on DIY Website Updates: 7 Quick Security Hacks Every Business Owner Should Know

WordPress Security MistakesLet’s be honest, you didn’t start your business to become a cybersecurity expert. You’ve got products to sell, customers to serve, and a bottom line to protect. But here’s the thing: spending hours wrestling with complicated security tutorials isn’t the answer.

The good news? Website security doesn’t have to eat up your entire weekend. With these seven practical hacks, you can lock down your site without needing a computer science degree. These aren’t theoretical tips, they’re battle-tested strategies that take minutes to implement but provide months of protection.

Think of this as your security cheat sheet. No fluff, no technical jargon, just straight-forward steps that actually work.

1. Turn On Multi-Factor Authentication (MFA) Everywhere

Here’s your first quick win: enable multi-factor authentication on every account that touches your business. This means requiring two forms of identification, like your password plus a code sent to your phone, before anyone can access your systems.

Why does this matter? Even if hackers crack your password, they still can’t get in without that second verification step. It’s like having a deadbolt and a security chain on your front door.

Set this up on your website admin panel, email accounts, social media profiles, and any business applications you use. Most platforms make this incredibly easy, usually just a toggle switch in your security settings.

Don’t skip this step because it seems like a hassle. The extra 30 seconds during login is nothing compared to the weeks you’d spend recovering from a breach.

2. Get That SSL Certificate Installed (And Keep It Updated)

If your website URL doesn’t start with “https://”, you’re broadcasting to the world that your site isn’t secure. Visitors see those dreaded “Not Secure” warnings, search engines penalize your rankings, and hackers see an easy target.

An SSL certificate encrypts data between your website and visitors. It’s like putting your conversation in a locked briefcase instead of shouting it across a crowded room.

Most hosting providers offer SSL certificates for free or under $20 per year. If you’re not sure whether yours is installed correctly, just look at your address bar. You should see a little lock icon next to your domain name.

Pro tip: Set a calendar reminder to check your SSL certificate renewal date. An expired certificate means your site goes back to showing security warnings, not exactly the professional image you want.

3. Schedule Monthly 15-Minute Security Checkups

Here’s where most business owners go wrong: they set up security once and forget about it. That’s like installing smoke detectors and never checking the batteries.

Instead, block out 15 minutes each month for a quick security review. During this time, scan for suspicious login attempts, check for broken or modified pages, and verify your backups are working.

You don’t need fancy tools for this. Most content management systems have built-in activity logs that show recent changes and user logins. Look for anything unusual, logins from strange locations, files you didn’t create, or pages that suddenly load slowly.

Think of this as preventive maintenance for your digital storefront. Catching problems early means fixing them takes minutes instead of days.

4. Enable Automatic Updates (Yes, Really)

“But what if an update breaks my site?” This fear keeps many business owners running outdated, vulnerable software. Here’s the reality: the risk of a hacker exploiting an old security hole far outweighs the small chance an update causes problems.

Software updates aren’t just about new features, they’re about patching security vulnerabilities that hackers actively target. Running outdated software is like leaving your keys in an unlocked car.

Enable automatic updates for your website’s core software, plugins, and themes. If your platform doesn’t support automatic updates, set weekly calendar reminders to install them manually.

Still worried about updates breaking things? That’s what backups are for (more on that in tip #6). The peace of mind from staying current on security patches is worth the occasional minor glitch.

5. Implement a Real Password Policy

“Password123!” doesn’t count as secure, no matter how many exclamation points you add. Weak passwords are like having a “Welcome” mat for hackers.

Create a simple password policy for your team: minimum 12 characters, mix of letters/numbers/symbols, and no reusing passwords across accounts. Better yet, use a password manager to generate and store complex passwords automatically.

Think about what’s connected to your email accounts, your website admin panel, and your business applications. One compromised password can unlock everything. Don’t make it easy for the bad guys.

If remembering complex passwords feels overwhelming, password managers like Bitwarden or LastPass do the heavy lifting. They generate random passwords and fill them in automatically, security made simple.

6. Set Up Automatic Backups and Vulnerability Scanning

Imagine losing months of work because your website got hacked or your server crashed. Now imagine getting everything back with the click of a button. That’s the power of automatic backups.

Configure daily backups of your entire website: files, database, everything. Store these backups off-site, not on the same server as your website. Many hosting providers include this service, or you can use plugins that backup to cloud storage.

Pair this with vulnerability scanning. Services like Sucuri or Wordfence automatically check your site for malware, outdated software, and security holes. They send email alerts when they find problems, so you can fix issues before hackers exploit them.

The goal isn’t to never have problems: it’s to bounce back quickly when they happen. Automatic backups and scanning give you that resilience without ongoing effort.

7. Audit Your Plugins and Third-Party Tools

Your website is only as secure as its weakest link. That forgotten plugin you installed two years ago might be full of security holes, giving hackers a backdoor into your site.

Conduct a quarterly audit of every plugin, integration, and third-party tool connected to your website. Ask yourself: “Do I actually use this? Is it from a reputable developer? When was it last updated?”

Delete anything you don’t actively use. For the tools you keep, enable security notifications so you know about vulnerabilities immediately. Subscribe to security blogs or newsletters from your plugin developers.

This includes seemingly harmless additions like social media widgets, analytics tools, and contact forms. Each one represents a potential entry point. The fewer doors you have, the fewer you need to guard.

The Bottom Line: Security as a Business Habit

These seven hacks work because they create multiple layers of protection without requiring constant attention. You’re not trying to become a security expert: you’re building good habits that run on autopilot.

The key is treating security like any other business routine. You wouldn’t skip payroll or forget to pay rent. Website security deserves the same consistent attention.

Start with multi-factor authentication and SSL certificates: these give you the biggest security boost for the least effort. Then work through the other tips over the next few weeks.

Your future self will thank you when you’re running a secure, professional website instead of dealing with the aftermath of a security breach. And your customers will appreciate knowing their information is safe in your hands.

Need help implementing any of these security measures? Our team at The CharlesWorks Corner specializes in making website security simple and manageable for busy business owners. Don’t let security concerns keep you up at night when practical solutions are just a click away.

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

The CW Corner – 7 Mistakes You’re Making with WordPress Security (and How to Fix Them Before Hackers Strike)

WordPress Security MistakesWordPress powers over 40% of all websites on the internet. That popularity makes it a prime target for hackers. Every day, thousands of WordPress sites get compromised because owners make simple security mistakes.

The good news? Most of these mistakes are easy to fix. You don’t need to be a security expert to protect your website. You just need to know what you’re doing wrong and how to fix it.

Let’s dive into the seven biggest WordPress security mistakes and their solutions.

Mistake #1: Ignoring Updates (The Silent Site Killer)

Here’s the harsh truth: 97% of WordPress security problems come from plugins. Yet only 30% of WordPress users have auto-updates enabled.

Think about it this way. When developers find a security hole, they release an update to fix it. The longer you wait to update, the more time hackers have to exploit that known weakness.

How to Fix It:
Enable automatic updates for WordPress core, plugins, and themes. Most hosting providers offer this feature in their control panels. If yours doesn’t, consider switching to a managed WordPress host.

Check your plugins weekly. Delete any you’re not using. Inactive plugins can still be exploited by hackers.

Set calendar reminders if auto-updates aren’t available. Manual updates beat no updates every time.

Pro Tip: Create a staging site to test updates before they go live. This prevents your main site from breaking during updates.

Mistake #2: Using Weak Passwords and Predictable Usernames

“admin” with password “password123” isn’t clever. It’s dangerous. 41% of WordPress users still use weak passwords or skip two-factor authentication entirely.

Hackers use bots that test thousands of password combinations per minute. A weak password like “ADMIN123” gets cracked in seconds.

How to Fix It:
Create strong passwords with at least 12 characters. Mix uppercase, lowercase, numbers, and special characters.

Never use “admin” as your username. Choose something unique that doesn’t relate to your business name.

Use a password manager like 1Password or Bitwarden. They generate complex passwords and store them securely.

Change default usernames immediately. If you already have an “admin” account, create a new administrator account with a different username, then delete the old one.

Quick Check: Can you guess your password by looking at your keyboard or personal information? If yes, change it now.

Mistake #3: Skipping Two-Factor Authentication (Your Security Backup Plan)

Passwords alone aren’t enough anymore. Even strong passwords can be compromised through data breaches or phishing attacks.

Two-Factor Authentication (2FA) adds a second layer of protection. Even if hackers get your password, they still need your phone or authentication app to get in.

How to Fix It:
Install a 2FA plugin like Wordfence or Google Authenticator for WordPress.

Set up 2FA for all user accounts, especially administrators and editors.

Use an authenticator app instead of SMS when possible. Apps like Google Authenticator or Authy are more secure than text messages.

Test your 2FA setup regularly. Make sure you can access backup codes if you lose your phone.

Remember: 2FA might seem inconvenient, but it’s much less inconvenient than rebuilding your hacked website.

Mistake #4: Forgetting to Back Up Your Website

“My hosting company handles backups.” Famous last words from website owners who lost everything.

Hosting backups might not include all your files. They might be stored on the same server that gets hacked. Or they might be overwritten before you realize you need them.

How to Fix It:
Set up automated daily backups that include your entire website and database.

Store backups in multiple locations. Use cloud services like Google Drive, Dropbox, or Amazon S3.

Test your backup restoration process monthly. A backup that doesn’t restore is useless.

Keep at least 30 days of backup history. Sometimes you don’t notice problems immediately.

Use plugins like UpdraftPlus or BackWPup for automated scheduling.

Reality Check: When did you last check if your backups actually work? If you can’t answer that, check today.

Mistake #5: Installing Themes and Plugins from Sketchy Sources

Free premium themes and plugins sound tempting. But they often come with hidden malware or backdoors that give hackers access to your site.

Even legitimate-looking themes can contain malicious code that steals user data or redirects visitors to scam sites.

How to Fix It:
Only download themes and plugins from the official WordPress repository or established developers.

Check ratings and reviews before installing anything. Look for recent updates and active support.

Research the developer. Do they have other plugins? A professional website? Good reviews?

Scan new themes and plugins with security tools before activation.

Delete unused plugins immediately. Don’t just deactivate them: remove them completely.

Warning Sign: If a “premium” theme or plugin is offered free on a random website, it’s probably infected with malware.

Mistake #6: Ignoring File Permissions (The Technical Blind Spot)

File permissions control who can access what on your server. Wrong permissions can let hackers read sensitive files or upload malicious code.

Most WordPress users never check their file permissions. They assume their hosting provider set them correctly. That’s a dangerous assumption.

How to Fix It:
Set correct file permissions: 755 for directories and 644 for files.

Never use 777 permissions unless absolutely necessary (and change them back immediately after).

Protect your wp-config.php file with 600 permissions.

Work with your hosting provider to audit permissions if you’re unsure.

Use security plugins that monitor and alert you about permission changes.

Technical Note: If file permissions sound too complex, ask your web developer or hosting support to check them for you.

Mistake #7: No Security Monitoring (Flying Blind)

Many WordPress owners only discover they’ve been hacked when visitors complain or Google flags their site. By then, the damage is done.

Hackers often work silently, stealing data or using your site to attack others. You need active monitoring to catch problems early.

How to Fix It:
Install security monitoring plugins like Wordfence, Sucuri, or iThemes Security.

Set up email alerts for suspicious login attempts, file changes, or malware detection.

Monitor your website traffic for unusual spikes or patterns.

Check your site regularly from different devices and browsers.

Use Google Search Console to monitor for security warnings.

Pro Tip: Set up uptime monitoring to alert you immediately if your site goes down. Services like UptimeRobot offer free basic monitoring.

Taking Action: Your Security Checklist

Security isn’t a one-time task. It’s an ongoing process. Here’s your priority order for fixing these mistakes:

  1. Enable automatic updates immediately – This fixes your biggest vulnerability right now
  2. Change weak passwords and usernames – Use a password manager to make this easy
  3. Set up 2FA on all accounts – Add that crucial second layer of protection
  4. Configure automated backups – Your safety net for when things go wrong
  5. Audit your plugins and themes – Remove anything suspicious or unused
  6. Check file permissions – Get help if this feels too technical
  7. Install security monitoring – Your early warning system

Don’t try to fix everything at once. Start with automatic updates and work down the list. Each step makes your site significantly more secure.

Remember: The best time to secure your WordPress site was yesterday. The second-best time is right now.

Need help implementing these security measures? Our team specializes in WordPress security and can audit your site for vulnerabilities. Contact us for a security consultation that could save your website from becoming another hacking statistic.

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

The CW Corner – Local SEO Secrets Revealed: What Web Developers Don’t Want You to Know About Ranking Your Small Business

Developing Local SEO StrategyYou’re paying for a website, but your local customers can’t find you online. Sound familiar? Here’s the truth: most web developers focus on making sites look pretty. They skip the local search engine optimization (SEO) tactics that actually get you found.

Local SEO isn’t rocket science. It’s a series of strategic moves that help your business appear when people search for services “near me.” The best part? You can implement most of these yourself.

Let’s dive into the strategies that actually move the needle for small businesses.

Your Google Business Profile Is Everything

Your Google Business Profile is the foundation of local visibility. It’s free, takes 15 minutes to set up, and directly impacts your Google Maps rankings.

Think about your last local search. You probably clicked on one of the first three businesses in the map results. Those spots aren’t random, they’re earned through profile optimization.

Complete every section of your profile. Add your business hours, phone number, website, and services. Upload high-quality photos of your storefront, products, and team. Businesses with photos get 42% more direction requests than those without.

Post regular updates about promotions, events, or new services. Google treats active profiles as more relevant than dormant ones. Even a weekly post about your business makes a difference.

Enable messaging if your business can respond quickly. Enable appointment booking if applicable. These features signal to Google that your business is engaged and customer-focused.

NAP Consistency Rules Everything

NAP stands for Name, Address, Phone Number. This information must be identical everywhere your business appears online. Everywhere means your website, social media, directories, and citations.

Here’s what happens when your NAP is inconsistent: Google doesn’t trust your business information. Confused search engines don’t rank confused businesses highly.

Create a master document with your exact business information. Use “Street” instead of “St.” Use your local phone number, not a toll-free number. If your business name is “Joe’s Coffee,” don’t call it “Joe’s Coffee Shop” anywhere else.

Check your NAP across these platforms: Google Business Profile, Yelp, Facebook, Yellow Pages, Better Business Bureau, and industry directories. Fix any inconsistencies immediately.

One formatting tip that saves headaches later: always use your business address exactly as it appears on your Google Business Profile. This becomes your standard format everywhere else.

Local Keywords Are Your Best Friend

Local keywords help the right people find your business. These aren’t complicated, they’re simply your services plus your location.

Examples include “dentist in Portland,” “pizza delivery Chicago,” or “car repair near me.” Research what your customers actually search for using Google’s Keyword Planner or simply by typing your services into Google and seeing the autocomplete suggestions.

Create separate pages for different service areas if you serve multiple locations. A plumbing company serving three towns should have dedicated pages for each area. Each page should include local landmarks, neighborhood names, and area-specific information.

Don’t stuff keywords unnaturally into your content. Write for humans first, search engines second. A sentence like “Our Chicago pizza delivery service delivers pizza in Chicago” sounds robotic and hurts more than it helps.

Instead, write naturally: “We deliver fresh pizza throughout Chicago’s downtown area, including the Loop and River North neighborhoods.”

Mobile Optimization Can’t Be Optional

Sixty percent of local searches happen on smartphones. Google uses mobile-first indexing, meaning they primarily look at your mobile site to determine rankings.

Your website must load quickly on phones. Compress images, choose a fast hosting provider, and avoid heavy plugins that slow loading times. A three-second delay can lose 53% of mobile visitors.

Make buttons large enough for thumbs. Avoid tiny links or navigation elements that frustrate mobile users. Test your site on different devices and screen sizes.

Eliminate pop-ups that cover mobile screens. Google penalizes sites with intrusive mobile pop-ups. If you must use pop-ups, make them easy to close and ensure they don’t block important content.

Check your mobile-friendliness with Google’s Mobile-Friendly Test. It’s free and shows exactly what needs fixing.

Customer Reviews Drive Everything

Reviews influence both customers and search rankings. Google considers review quantity, frequency, and responses when determining local rankings.

Ask satisfied customers for reviews. Don’t be pushy, but don’t be shy either. A simple request after completing good work often works: “If you’re happy with our service, a quick Google review would really help our small business.”

Respond to every review, positive and negative. Thank customers for positive reviews. Address negative reviews professionally and offer to resolve issues offline.

Here’s a template for negative review responses: “Thanks for your feedback, [Name]. We apologize for your experience and would like to make this right. Please call us at [phone] so we can discuss this further.”

Never ignore reviews. Silent businesses look unengaged to both customers and Google.

Local Directories Still Matter

Getting listed on local directories builds credibility and provides valuable backlinks to your website. Start with major directories like Yelp, Yellow Pages, and your local Chamber of Commerce website.

Industry-specific directories matter too. Restaurants should be on OpenTable and TripAdvisor. Contractors should be on Angie’s List and Home Advisor.

Ensure your NAP information is consistent across all directories. Inconsistent listings hurt more than they help.

Don’t pay for directory submissions unless you’re certain they’re legitimate. Many “directory submission services” are scams that list your business on low-quality sites.

On-Page SEO With Local Focus

Optimize your website content for local search by including location-based keywords naturally throughout your pages.

Your homepage should mention your primary service area early and often. Include your city or region in your title tag, meta description, and main headings.

Create location-specific content that provides value. A home improvement company could write about local building codes, weather considerations, or neighborhood characteristics.

Add your address to your website footer. Include local landmark references in your content. Mention nearby businesses, events, or community involvement.

Don’t forget about image optimization. Name your photos with descriptive, location-specific filenames like “chicago-pizza-restaurant-interior.jpg” instead of “IMG_1234.jpg.”

Advanced Local SEO Tactics

Geo-tag your images when uploading to your website and social media. This embeds location data that helps search engines understand your business location.

Build relationships with other local businesses for natural backlink opportunities. Sponsor local events, join community organizations, or participate in local business associations.

Create Google Posts regularly through your Google Business Profile. These mini-blog posts appear in your knowledge panel and show Google that your business is active.

Monitor your online mentions using Google Alerts. Set up alerts for your business name to catch new reviews, mentions, or potential NAP inconsistencies.

Consider local schema markup on your website. This structured data helps search engines understand your business information more clearly.

Common Mistakes That Kill Local Rankings

Buying fake reviews destroys credibility and violates Google’s guidelines. Focus on earning authentic reviews through excellent service.

Using inconsistent business names across platforms confuses search engines. Stick to one version of your business name everywhere.

Ignoring negative reviews makes problems worse. Address concerns professionally and publicly to show potential customers how you handle issues.

Creating multiple Google Business Profiles for one location results in suspension. Google allows one profile per location, period.

Measuring Your Local SEO Success

Track your Google Business Profile insights to see how customers find you. Monitor calls, website clicks, and direction requests.

Use Google Search Console to see which local keywords drive traffic to your website. Focus your efforts on keywords that generate actual business.

Check your local rankings monthly for your most important keywords. Tools like BrightLocal or simply searching on different devices can show your position.

Most importantly, track actual business results. More calls, appointments, or walk-ins matter more than rankings alone.

Local SEO isn’t complicated, but it requires consistency and attention to detail. Start with your Google Business Profile, fix your NAP consistency, and build from there. Your local customers are searching for your services right now( make sure they can find you.)

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

The CW Corner – Adding a SimplePractice Widget to a Divi Website

SimplePractice: Incorporating its Widget into your WordPress Divi Website

This article is about adding the SimplePractice widget to your WordPress website that uses the Divi theme. I’ll explain what SimplePractice is and get into how to install its widget into your WordPress Divi website.

Simplifying Practice Management for Mental Health Professionals

LADAC session depiction with clientSimplePractice is a trusted all-in-one platform designed to make life easier for mental health professionals and other wellness practitioners. See https://SimplePractice.com for more details. It streamlines essential administrative tasks like scheduling, billing, documentation, and client communication, allowing practitioners to focus on what truly matters—their clients. With a user-friendly interface and powerful tools, it’s an ideal solution for solo practitioners and small group practices.

One of the standout features is its online scheduling tool, which lets clients book appointments through a secure, HIPAA-compliant client portal. This portal also allows clients to complete intake forms, sign documents, and even message their provider—all in one place. For therapists who offer virtual sessions, the telehealth integration enables seamless video appointments without the need for third-party apps.

SimplePractice also simplifies billing and insurance management. Providers can create invoices, process payments, and submit insurance claims directly through the system. Plus, its customizable progress notes and treatment plan templates make maintaining records both quick and efficient.

What makes SimplePractice shine is its simplicity. The platform is intuitive and easy to navigate, with minimal learning curves for both practitioners and their clients. The robust support team and extensive online resources ensure any questions are resolved quickly.

Whether it’s automating reminders, securely managing client data, or customizing a practice’s workflow, SimplePractice makes running a private practice straightforward and stress-free. It’s the tool busy professionals rely on to save time, stay organized, and provide exceptional care.

The SimplePractice appointment request widget can be incorporated into a development domain for your client’s pending Divi site and ultimately in the live site. Here’s how you can achieve this:


Step 1: Review the Widget Code

Once you have the widget code from the client, you need to verify its structure. Typically, it includes a <script> tag provided by SimplePractice. For example:

<div id="spwidget-container"></div>
<script src="https://widget.simplepractice.com/js/embed.js" data-sp-client-id="your-client-id"></script>

The data-sp-client-id is unique to your client’s SimplePractice account, so ensure that value matches.


Step 2: Add the Widget Code to the Divi Site

In Divi, you can embed custom code into the site using the Code Module or Theme Builder:

  1. Using the Divi Code Module:
    • Open the page or section where you want to display the widget.
    • Add a Code Module within the desired row or column.
    • Paste the SimplePractice widget code into the module.
    • Save the changes and preview to ensure the widget appears as expected.
  2. Using Divi Theme Builder (if the widget should appear site-wide):
    • Navigate to Divi > Theme Builder in the WordPress dashboard.
    • Create or edit a custom header, footer, or body section.
    • Add a Code Module and paste the widget code.
    • Assign the template to the desired pages or the entire site.

Step 3: Customize the Widget (Optional)

The Customizing Your Widget section in the SimplePractice documentation explains how you can:

  • Change colors, fonts, and styles to match the Divi site’s design.
  • Customize settings by modifying the <script> code parameters.

If your client’s code already includes customization, verify if it aligns with the new site’s look. For further adjustments, update the styles within the widget script.


Step 4: Use the Development Domain

SimplePractice widgets do not rely on a specific domain to function, as long as the data-sp-client-id is correct. You can install and test the widget on the development domain without any issues. Once the site goes live on the actual domain, the widget should still work without changes.

However, after the site goes live, it’s good practice to:

  • Confirm the widget works properly on the live domain.
  • Recheck any customized URLs or redirects tied to the widget to ensure they match the live setup.

Step 5: Test the Integration

  1. Navigate to the development site.
  2. Test the widget to ensure it displays and works correctly (e.g., appointment requests can be submitted).
  3. Check for any conflicts with other scripts or plugins on the Divi site.
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

The CW Corner – Getting Through a Pandemic Together

Here we are at the 4th of July of 2021 already! The loss of life suffered in 2020 was horrendous. Yet there are people who still do not think in terms of helping their fellow citizens – and themselves – by being vaccinated. The vaccine misinformation mills are in full production.

So think about this: Exactly who benefits when we don’t vaccinate? When more of us are ill and can’t work, the economy suffers. There is no way the government wants that. They want us to all work so they can collect taxes from our labor. Enemies of America benefit when we don’t vaccinate. Who benefits when we do? We all benefit. The economy will return to normal – as will our lives.

At CharlesWorks we all chose to be vaccinated. Each of us employed here cares about ourselves and our clients. So when you make an appointment with us in person you can at least rest assured we have taken steps indicating we care about you.

The CharlesWorks policy is that the COVID unvaccinated need not apply. That is one of the many ways we show we care about others.

Vaccination will help us return to normalcy. It is a small thing to do. It is the patriotic thing to do. It is the right thing to do.

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

The CW Corner – Adding Custom Shortcodes to WordPress

I wanted to create a custom HTML code function, so made one that will generate a line feed. I tested it to neaten up the output from my favorite WordPress statistics plugin: WP-Statistics by Verona Labs.

This shortcode gives the ability to add line feeds to WordPress page, post or report outputs to improve their readability. The function can easily be modified to generate any HTML output by doing this:

  • rename “newline” in the “add_shortcode” line to whatever you’d like the shortcode to be named
  • adjust the HTML code inside the quotes in the “return” line

In this example, we’ll create the line break shortcode.

Creating the Line Break Shortcode

Adding shortcodes in WordPress is easily accomplished by simply inserting the appropriate coding for the shortcode into your child theme’s functions.php file.

Note: Child themes should always be used. Changes made directly to the parent theme’s files are usually overwritten each time the parent theme is updated.

To add the code, first back up your site and then do the following:

  • Log into the WordPress Dashboard as an administrator
  • Navigate to Appearance > Theme Editor
  • Select Theme Functions (functions.php) under Theme Files in the right column
  • Add the short function code lines below
/* -- Start of line breaks shortcode --*/
function line_break_shortcode() {
return '<br />';
}
add_shortcode( 'newline', 'line_break_shortcode' );
/* -- End of line break shortcode --*/

Adding Line Breaks

Once the code has been added to your functions.php file, all you have to do is add the
shortcode in your text to generate a line feed at that point. The beauty of doing this as a shortcode is that it can be inserted in places that do not normally allow you to add them – like in the email output of the WP-Statistics plugin.

Note: When testing your output from the WP-Statistics plugin, there is a convenient feature that allows you to send output every minute to see what you will be sending. As a rule I normally have the report set to send daily.

A Working Example

There were a couple of WP-Statistics report items that were of particular interest to me. One is the last post date. This is handy as a reminder when one should add one or more posts to a site – especially a blog – so the site content doesn’t appear stale (or as an alternative, simply do not show blog post creation dates). Even if you are not displaying the post dates on the site, it is good to know when you last posted something.

An example of the report pattern I used was this (note that in some WordPress themes the “[” and “]” characters in the example below display as repeated – there should only be one “[” opening shortcode character and one “]” closing shortcode character surrounding the shortcode itself when you use it):

WP Statistics report for https://CWCorner.com WordPress site:
[newline]
_______________________________________________
[newline]
[newline]
Last post date: [wpstatistics stat=lpd]
[newline]
Total Site Posts: [wpstatistics stat=postcount]
[newline]
Total Site Pages: [wpstatistics stat=pagecount]
[newline]
Total Site Users: [wpstatistics stat=usercount]
[newline]
Online Users at Report Time: [wpstatistics stat=usersonline]
[newline]
_______________________________________________
[newline]
[newline]
Today's Visitors so far: [wpstatistics stat=visitors time=today]
[newline]
Today's Visits so far: [wpstatistics stat=visits time=today]
[newline]
Yesterday's Visitors: [wpstatistics stat=visitors time=yesterday]
[newline]
Yesterday's Visits: [wpstatistics stat=visits time=yesterday]
[newline]
_______________________________________________
[newline]
[newline]
Total Visitors: [wpstatistics stat=visitors time=total]
[newline]
Total Visits: [wpstatistics stat=visits time=total]
[newline]
_______________________________________________
[newline]
[newline]
End of WP Statistics Report.
[newline]

I used the underline characters to separate various parts of the output for clarity. This report pattern generated a nicer, more readable report that even looked great when viewing it on my cell phone.

While I initially added this function as a way to neaten up the output of the WP-Statistics email report – the function should work just about anyplace in WordPress except in the PHP coding itself.

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail