EDITS.WS

Author: Nick Schäferhoff

  • How to Improve First Input Delay (FID) on Your WordPress Site

    We recently started off a new series on Google’s Core Web Vitals metrics with a post on Largest Contentful Paint. Here, we want to continue with the next candidate in line: First Input Delay or FID for short and how to improve it in WordPress.

    In the following, we will take a deep dive into what FID is and how to optimize your WordPress website for it. You’ll learn to understand and measure First Input Delay, what value you should aim for, and how to improve it if necessary.

    Note that this post assumes that you are already familiar with Google Core Web Vitals and their impact on user experience and search engine optimization. If you are unsure about any of this, check the first article in this series or our standalone post on Core Web Vitals.

    What Is First Input Delay? A Definition

    So, as already mentioned, FID is one of three metrics for measuring website user experience that Google considers as core values to judge how user friendly a website is. It’s also part of their search algorithm, so if you score badly on this, your search ranking will suffer.

    However, what exactly is First Input Delay?

    In short, FID quantifies the delay between the time a user interacts with a web page (such as clicking a button) and the time when the browser is able to respond to that interaction. This reflects the responsiveness of a web page.

    runner on starting blocks symbol for first input delay

    While Largest Contentful Paint calculates how long it takes for a web page to become useful to a visitor, FID measures how well it stays useful by performing whatever action the visitor wants – even during load. Naturally, if your site is more responsive, it makes for a better user experience.

    You probably know this from your own Internet usage. Ever been on a site that took way too long to react to your input? You didn’t like that, did you? Well, neither do your website visitors.

    How Is FID Calculated?

    FID is measured in milliseconds (ms). To calculate it, the browser tracks the moment a user interaction occurs on a page and the time it takes for the browser’s main thread to process that interaction. The FID score represents the delay between the two events. As a consequence, a low FID score indicates that the page is highly interactive and responds quickly to user input.

    At this point, you probably have to questions: What is the “main thread”? And what counts as an interaction?

    Here’s the answer.

    The main thread is basically the browser’s work pipeline. All processes that are necessary to render and run a website run through it. If it is constantly busy, it takes longer before it can react to new input.

    metal pipes as stand in for browser main thread

    As for what counts as an interaction, that can be a click on a link, a tap on a button, using a drop-down menu, text field, checkboxes, or radio buttons, as well as pressing a key on your keyboard (e.g. Esc to close a popup).

    What Causes FID?

    First Input Delay is often highest between First Contentful Paint (when the first page element appears in the browser window) and Time to Interactive (when the page first becomes usable and responsive to user input).

    Basically, input delay stems from when the browser is busy with something else while the user tries to do something. In that case, it can’t respond timely to the input, resulting in waiting time for the site visitor.

    On the technical side, common culprits for this are:

    • Large JavaScript files that the browser needs to parse and execute
    • Render-blocking resources that it has to wait for
    • Heavy calculations, DOM manipulation, or resource-intensive processes
    • Slow network connections or high latency that can lead to delays in fetching website files and other resources
    • Activities that block the main thread, such as heavy animations, long-running CSS transitions, or large image processing

    One last thing that is important to note about First Input Delay is that it will be replaced by another metric called Interaction to Next Paint (INP) in March 2024. However, for now FID is what we are working with, so it still matters that you get familiar with it.

    How to Measure First Input Delay

    You can test your website’s FID with pretty much the same tools as the other Core Web Vitals:

    • PageSpeed Insights — Simply enter your page URL and receive a report including your FID value.
    • Chrome User Experience Report — Google collects and compiles real user experience data from many websites through its browser. You can access this data through different tools, including those mentioned here.
    • Search Console — The Web Vitals report in Google Search Console lets you know about pages with bad FID readings.
    • web-vitals JavaScript library — If you are more technically inclined, you can build this JavaScript library into your website and get the information about Core Web Vitals from there.

    Most of these tools simply show the FID value in their results so you know what you are dealing with.

    fid metric in pagespeed insights

    What’s important to note is that you need real user interaction for this metric. It is not something you can simulate in a lab-type environment. Therefore, your best sources for this is real user data like from the CrUX report.

    If you want to test your site in a lab environment beforehand, your best proxy metric is Total Blocking Time. You can also find that in PageSpeed Insights, for example.

    total blocking time in pagespeed insights

    In addition, focus on the really worst cases of FID on your site, it will tell you the most about what is wrong.

    What Is a Good First Input Delay?

    That only leaves the question, what number should you shoot for? A good FID score is typically below 100 milliseconds. Scores between 100 and 300 milliseconds are considered to need improvement. Everything over 300 milliseconds indicate a poor user experience.

    first input delay performance scale

    So, with these benchmarks in mind, let’s learn how to make the First Input Delay on your site better.

    How to Improve First Input Delay on Your WordPress Website

    Improving FID mostly involves optimizing the web page’s performance and reducing any blocking tasks that may delay the browser’s response to user input. The most common culprit for the latter is heavy or incorrect use of JavaScript. For that reason, much of the measures below will focus on that. However, there are also other things you can do.

    General Performance Improvement Measures

    A lot of the techniques that we already covered for how to improve Largest Contentful Paint also apply when you want to make your FID better, including:

    • Optimize your website environment — The faster your website generally, the quicker resources can be delivered, reducing time to interactivity. Therefore, invest in quality hosting, themes, and plugins. In addition, reduce the number of plugins on your site and keep it updated. In addition, implement caching and compression.
    • Implement a CDN — Content delivery networks allow you to shorten the distance between the server and the user, also resulting in faster file delivery.
    • Eliminate render-blocking resources — Any parts of a website that stall the loading process negatively impact all parts of the user experience and Core Web Vitals. Eliminating them from your site helps correct that problem. More details on render-blocking JavaScript below.

    For more tips, check out our article on how to speed up WordPress, how to reduce server requests, and about speed testing your website.

    Reduce, Defer, Async, and Minify Your JavaScript

    As mentioned, JavaScript is usually the main factor for bad FID results. Here is how you can optimize the markup on your site so that it doesn’t become a problem.

    Reduce the Overall Markup

    Of course, the best thing you can do is to reduce the overall JavaScript on the page. Check the Coverage tab in your browser developer tools to find the unused JavaScript on a web page.

    coverage data of unused css javascript in chrome developer tools

    See if it is necessary for your site as a whole or if you can remove the unused JavaScript altogether.

    In WordPress, excessive JavaScript is often the result of too many plugins or themes that come with a lot of bells and whistles causing First Input Delay. So, if you want to get rid of it, check if there is a way you can eliminate some of them or switch to a leaner version.

    Async and Defer Scripts

    After that, the next step is to optimize JavaScript delivery to the browser. The main problem here is that, unless otherwise specified, when the browser encounters a JavaScript script in your website markup, it stops rendering HTML until the script has been downloaded and executed. This also referred to as the “render-blocking resources” mentioned above.

    However, there are ways around it and they are based on two keywords:

    • async – Adding this to your script call allows the browser to download it in the background without pausing the processing of the page. It will only execute once downloaded, independently of the rest of the page.
    • defer – Very similar to async. It tells the browser not to wait for the script and instead keep building the page. However, in this case, it will load the script last, when the rest of the page has been fully built.

    Here’s what using async and defer looks like in practice:

    <script async src="https://mywebsite.com/wp-content/themes/mytheme/analytics.js"></script>
    <script defer src="https://mywebsite.com/wp-content/themes/mytheme/analytics.js"></script>

    As you can imagine, both of these methods can result in significant time saved during page load. Their main difference: defer keeps the relative order of scripts the way they appear in the document, while async uses the order in which the scripts are done downloading.

    You can use both to make unused and non-critical JavaScript load later. This includes third-party scripts such as analytics.

    Minify JavaScript for Faster Download

    Finally, for the JavaScript that does get loaded, be sure to minify it. Minification means removing all markup and code formatting that’s only there to make files legible for humans.

    how to reduce http requests wordpress css minification example

    It further reduces the file size and makes them faster for the browser to download. There are plenty of tools out there to do this, including the plugin recommendations below.

    Break Up Long Tasks

    Besides reducing the overall JavaScript on your site and improving delivery, you can optimize First Input Delay on your WordPress site by breaking what remains down into smaller chunks. This is especially suitable if you have a lot of “long tasks” on your page.

    What are long tasks, you ask?

    Anything that blocks the main thread for more than 50ms. You can see these in Chrome developer tools marked with red flags.

    long task red flags chrome developer tools

    If you cut them down into smaller parts, you can load them asynchonously, resulting in less uninterrupted work in the main thread.

    How do you do that?

    By using code-splitting. It allows you to load chunks of JavaScript conditionally so that only critically important code is loaded from the beginning. The rest only comes into play when necessary. You can also break up tasks into smaller separate functions. Both are ways to keep your pages responsive.

    For more very technical tips on how to handle long tasks check this resource.

    Useful WordPress Plugins to Improve FID

    We understand that optimizing JavaScript files is not everyone’s cup of tea, especially if you are not a developer. For that reason, we have compiled a few WordPress plugins and tools that can help you in making your First Input Delay values better.

    • Asset Cleanup – This plugin allows you to disable unused CSS and JavaScript, preload fonts, minify your files, defer JavaScript, and more.
    • Flying Scripts — Lets you delay the execution of non-critical JavaScript until the time there is no user activity.
    • Plugin Organizer — Change the order in which plugins load on your site and selectively switch them off on chosen pages or content types.
    • Autoptimize — Can combine and minify CSS and JS files automatically as well as add async and defer to scripts. It’s also super easy to use.
    • WP Rocket — A paid caching plugin that can do a lot of what we talked about above. Generally, most caching plugins offer similar functionality.

    Final Thoughts: First Input Delay in WordPress

    FID is one of the metrics that make up the triumvirate of Core Web Vitals and it measures the interactivity of web pages. Since nobody likes sluggish web experiences, this is an important part of user experience. By focusing on improving First Input Delay, website owners and developers can provide a more responsive user experience, and ultimately improve user satisfaction and engagement.

    Above, we have covered how to measure, test for, and improve FID on your WordPress website. While optimizing JavaScript might feel a bit out of reach for less-technical users, there is still a lot you can do to improve the overall performance of your site including FID. Hopefully, you feel capable of doing so by now.

    Do you have any other tips to improve First Input Delay on WordPress websites? Share your thoughts and recommendations below!

    The post How to Improve First Input Delay (FID) on Your WordPress Site appeared first on Torque.

  • Real-Time Collaboration in WordPress: Here’s What to Expect

    Bringing real-time collaboration or collaborative editing to WordPress will be the focus of the third phase of the Gutenberg project. It started off with the block editor in WordPress 5.0 and has by now progressed to Full-Site Editing aka the WordPress Site Editor. Adding real-time collaboration will be the second-to-last phase, while the final phase will add native multilingual capabilities.

    Lead Architect Matias Ventura recently posted a preliminary outline of what is planned for Phase 3. The planned changes will not only bring new functionality to WordPress but also necessitate rebuilding (large) parts of its interface. The developers also predict that collaborative editing is going to be the most challenging to build due to the scope.

    Reason enough to take a detailed look at what we can expect. In the following, we will go over what real-time collaboration is, what’s planned for this update, and the consequences for the WordPress platform. We will also go over ways you can already try out more collaborative workflows on your WordPress website right now.

    What is Real-Time Collaboration?

    If you have ever worked on a Google document together with other people, you already know what collaborative editing is. It is the ability for several users to edit a document at the same time, comment on make changes to other people’s work, and use shared assets together.

    real time collaboration collaborative editing example google docs

    This allows you to work on a single document collectively instead of giving each person a separate copy and combining their individual input later. You are also able to assign different roles to users that decide whether they can only see, comment on, or edit the content.

    Doing so saves time and effort, improves communication, and allows you to divide the labor. It can also result in better outcomes and makes the current work product available to every team member at the same time.

    Other software solutions also offer this functionality. Examples include Canva, Sketch, and Microsoft Office 365. However, it is currently not possible in WordPress, at least not by default. While you can work on content pieces together, it’s only possible to do so one user at a time. When one person is in the editing screen for a particular page or post, anyone else who tries to access it gets locked out or needs to kick out the original editor.

    “Supporting these workflows is not just about concurrency, though, but also about lifting restrictions that have been present in WordPress for a long time, such as locking a post when two people try to edit at the same time,” Ventura said in the post.

    wordpress content blocked while being edited

    With the planned real-time collaboration, it will be possible to work on content together as a team instead — right in the WordPress interface.

    Why Do We Need Collaborative Editing in WordPress?

    Yet, why is it the goal to implement this? After all, you could already simply use a Google document for the collaborative part and then copy over the result.

    However, copying and pasting content from Google Docs to WordPress does not always work perfectly. It can lead to errors and need reformatting before you can publish the content. In addition, any images included in the document first have to make their way over to WordPress. With a native solution, none of this would happen.

    In addition, there is a bit of a lack of collaboration tools in WordPress overall. Unless you install plugins for that purpose, there is no way to leave comments or feedback for other authors and users. Therefore, you often need to rely on other, asynchronous tools, like email or Slack to coordinate.

    asynchronous collaboration tool email

    Doing so will also often result in one person having to implement the suggestions from the rest of the team. Seeing as many websites and content strategies are run by teams, giving people tools to collaborate directly in the environment they are working in would go a long way in making the creation process more seamless.

    Plus, since the WordPress block editor can do both content and design, it would also help designers and content creators work together better. While one person can take care of the written part, the other can already start prettying it up.

    Finally, offering real-time collaboration is also simply a good way to improve the WordPress CMS and make it into a mroe modern piece of software.

    What Exactly Are the Developers Planning?

    In his post, Matias Ventura lays out the preliminary goals and ideas the developers are focusing on. Here is a breakdown of what they include.

    1. Real-time Content Collaboration

    Naturally, this is the centerpiece of the entire phase. The goal is to provide the necessary infrastructure and UI to allow multiple users to work together on the same content simultaneously. To create, edit, and customize web pages and posts as a team.

    2. Asynchronous Collaboration Tools

    However, working together on content doesn’t just mean the ability to be inside the editor at the same time. You also need tools to communicate effectively about what you are doing. Gutenberg Phase 3 also aims to provide those, including things like:

    • Draft sharing
    • Inline block commenting
    • Assignment review
    • Improved version control
    • Task management

    Some of this is currently already possible through plugins but the goal is to make it native.

    3. Improved Publishing Workflows

    Another goal is to provide better tools for creating, editing, reviewing, and publishing content within WordPress. This can include features such as:

    • Defining editorial requirements
    • Setting customized goals, e.g. a certain number of words or images
    • Prerequisites to complete before publishing is unlocked such as setting a featured image, etc.
    • Support for multiple preview contexts (e.g. members vs no members)

    The plan is not to necessarily include all of this in WordPress Core. However, Phase3 will provide the infrastructure to make it possible to implement this in the editor.

    4. More Powerful Post Revisions

    Naturally, to accommodate the added complexity, you need a more detailed post revision system. The plan is to make it “more visual, aware of individual blocks, and explore adding the ability to schedule revisions across multiple parts of a site”.

    What does that mean?

    First of all, it would add the ability to revert singular blocks to earlier versions, not just entire content pieces. Secondly, you would be able to update several content pieces at the same time, for example that belong to the same campaign.

    5. An Enhanced Media and Asset Library

    Another piece of WordPress that the developers want to work on is the media library. They want to provide not only a place for managing visuals but also blocks, block patterns, styles, and fonts.

    As part of this, it is necessary to enhance the media library’s design and functionality. Historically this is a part of WordPress that hasn’t seen a lot of work, so it would be exciting to find out how they can improve it.

    6. A Global Search and Command Component

    The final component that Matias is talking about in connection with real-time collaboration in WordPress is a command prompt such as Spotlight in MacOS.

    macos spotlight example

    It would allow users to navigate directly to content or different admin areas as well as run commands like “create a new post” or “insert pattern”. This is also in response to the surge in AI and to introduce functionality that is prompt-based. A Github repository for this already exists.

    Consequences of the Proposed Changes

    From the above, it should already be obvious that this will not just be simply another feature that’s added to WordPress. These changes will make it necessary to rebuild and change parts of the WordPress user interface. As Matias says in his post:

    To accomplish this, we’ll be looking beyond the editors at the rest of the admin experience.

    Especially the library will likely see a lot of work. Other areas include update admin notices and UI design components as well as the admin list views used in posts, pages, categories, templates, comments, and by hundreds of plugins. Those should receive a more modern design and better support for interactivity and extensibility. You can find early concepts here.

    So in short, real-time collaboration might change the very fabric of WordPress as we know it. We need to find entirely new workflows and design solutions to be able to incorporate it into the CMS.

    That’s also the reason why real-time collaboration is on the roadmap before multilingual capabilities. Many of the workflows have to be already in place before we can tackle native translation options as Josepha Haden Chomphosy and Hector Prieto discuss in this podcast.

    Technical Challenges for WordPress Real-Time Collaboration

    Of course, to take on something of this magnitude, there are a number of technical challenges to overcome. As states in the podcast episode above, collaborative editing is going to be especially difficult because of the need for real-time communication between different user browsers. If you want to read about the kind of problems that arise from this, read this account by the people who make the CKEditor (in a word, conflicts!).

    ckeditor schematic real time collaboration conflicts

    In addition, you need to take into consideration the diverse user base WordPress has and especially the different servers that they host their sites on.

    For example, Google had an easier time to add collaborative editing to their tools because they are hosting them themselves and have full server control. As a consequence, they mostly had to solve for different browsers.

    WordPress, on the other hand, runs on a myriad of server setups with various PHP versions and environments. Not all of them are equipped for all types of technical approaches. That’s also why no underlying technology has been chosen yet. Real-time collaboration is really in its early stages. It will take a lot more thinking and proofs of concept before a decision can be made.

    Besides, the developers will continue to work on projects related to earlier phases of Gutenberg. That includes adding more blocks, improved tables, a grid layout system, and improving the block API.

    How to Test Drive Collaborative Editing in WordPress Today

    If you are really curious about the topic of real-time collaboration in WordPress, there are a number of working prototypes and plugins that let you try ou this functionality now:

    • AsBlocks — Made by Riad Benguella, who works for Automattic, it demonstrates a collaborative editing experience inside the Gutenberg editor. You can try it out online here. It won’t look exactly like this but it shows one possibility. Read the accompanying blog post for more information.
    • Block Collab — Another prototype by Enrique Piqeras. It seems like it’s not currently under active development but might still be usable.
    • Multicollab — A plugin offering features such inline commenting, pinging users, marking comments as done, and email notifications. You can find a demo here (requires signup but comes with a 14-day free trial).

    One of them or part of one of them might even be the basis for the final feature. It’s not the first time that something first developed as a plugin ended up in core. The WP REST API and Gutenberg itself both started out that way.

    What Are Your Thoughts?

    Real-time collaboration has been on the WordPress roadmap for a long time. After finishing up the first two phases of the Gutenberg project, it is now the next step. The preliminary roadmap offers an exciting vision of the future of WordPress in which you can work on content together with all the necessary features for effective collaboration, synchronous and asynchronous.

    However, making it happen will need a lot of work and planning. The feature itself will probably change the WordPress platform as we know it and also to pave the way for the fourth phase and native multilingual support.

    However, if past developments are any indication, it won’t happen quickly but over time. For example, it is not part of the 6.3 release coming in August 2023. So we will see. Until then, share thoughts and give your input on the official post.

    Are you excited about collaborative editing in WordPress? What’s your favorite part? What are your concerns? Share in the comments!

    The post Real-Time Collaboration in WordPress: Here’s What to Expect appeared first on Torque.

  • Largest Contentful Paint (LCP) and How to Improve It in WordPress

    This post is the first in a three-part series about Core Web Vitals. In it, we want to go over each of the three metrics that are at the heart of Google’s new yard stick for website quality. Our first stop: Largest Contentful Paint (LCP) and how to improve it in WordPress.

    By now, Core Web Vitals are a critical ranking factor in Google. As measurements for user experience, they determine whether or not visitors have a good time on your site and also influence how well you do in search engines. For that reason, it’s important that you get them right.

    To help you do so, as mentioned, we want to examine each of the components of Core Web Vitals in depth. Below, we talk about what exactly they are and why they matter for SEO. After that, you get a grade-A education on how to ace Largest Contentful Paint, the first one of them, on your WordPress site. The post explains what LCP is, how to measure it, what number you should shoot for, and how to improve this metric on your WordPress site if necessary.

    What Are Core Web Vitals?

    heart monitor as a symbol for core web vitals

    First off, in case this topic is entirely new to you, let’s start with the basics: what exactly are Core Web Vitals?

    In short, they are a set of user-centered metrics that measure the loading speed, interactivity, and visual stability of web pages that Google introduced in May 2020. They are supposed to help website owners and developers understand how good of a user experience their pages offer and identify areas for improvement.

    Core Web Vitals consist of three metrics:

    1. Largest Contentful Paint (LCP)
    2. First Input Delay (FID)
    3. Cumulative Layout Shift (CLS)

    Each of these is measured separately and influenced by different factors, which is why we are writing this article series.

    Why Do Core Web Vitals Matter for SEO?

    The reason why we stress this point is pretty simple. Google has made it clear that it wants to prioritize pages that provide a pleasant experience to visitors who frequent them. Core Web Vitals are a way to measure that.

    As a consequence, by now they are a key component of Google’s algorithm for evaluating and ranking web pages. To quote their own page on that matter:

    Core Web Vitals are the subset of Web Vitals that apply to all web pages, should be measured by all site owners, and will be surfaced across all Google tools.

    Therefore, if you want your pages to perform well, you not only have to look at things like web design, E-A-T, content authority, on-page optimization, site speed, and mobile friendliness but also at these UX metrics. Otherwise, you might find yourself penalized by Google and not ranking well.

    In addition, improving Core Web Vitals can lead to better user engagement, longer site visits, and ultimately, increased conversions and revenue. So, optimizing your website for them not only helps with SEO, but also drives business results.

    All clear? Then let’s tackle the first metric.

    What Is Largest Contentful Paint (LCP)?

    paint roll on wall as symbol for largest contentful paint

    LCP is the first Core Web Vitals Metric we want to look at. It measures the time it takes for the largest element in the viewport (that’s what you see in your browser window) to become fully rendered on the screen after a user initiates a page load. It could be an image, video, text block, or any other element that occupies a significant amount of space on the page.

    LCP is an important metric because it reflects how quickly users can access the main content of a web page, which is likely what they came for in the first place. A slow LCP score means that users may have to wait longer before they can start reading or interacting with the page. This can lead to frustration and simply make them leave. No bueno.

    How Is Largest Contentful Paint Calculated?

    A page’s LCP score is determined by tracking how long in seconds the largest element in the viewport takes to become fully rendered. However, the metric only regards certain types of elements for its calculation:

    • <img> elements, meaning images
    • <image> elements inside <svg> documents
    • <video> elements that show a preview image
    • Elements that load a background image via the url() function
    • Block- and inline-level elements with text content

    In short, visuals and main text. At the same time, LCP disregards components that users likely do not consider to be “contentful”, such as:

    • Elements with an opacity of 0, that are invisible to the user
    • Elements that cover the full screen and likely function as background rather than content
    • Placeholder images or images with little information that likely do not reflect the true purpose of the page

    How to Test Your Site for LCP

    There are many ways to test Largest Contentful Paint on your WordPress website. As the quote above mentioned, it is now a metric in all Google tools, so you can start there.

    For example, when you input your website into PageSpeed Insights, you can find your LCP value and whether you have passed the test or not.

    lcp metric in pagespeed insights

    In addition, you find information about problems with Largest Contentful Paint and other issues in the Core Web Vitals report in Google Search Console.

    lcp issues in google search console

    Chrome developer tools also shows it (more on that below). Plus, there are browser addons that allow you to measure these metrics like Web Vitals for Chrome and SpeedVitals for Firefox. Finally, if you are a developer, you might want to use more technical solutions such as the web-vitals JavaScript library.

    What’s an Ideal LCP Value?

    After learning how to measure LCP, your next question is probably what exactly is a good value? What benchmark should you shoot for?

    In the case of Largest Contentful Paint, the magic number is 2.5 seconds. If your LCP score is less than 2.5 seconds, it is considered good. The page in question likely provides a good user experience. If your score is between 2.5 and 4 seconds, Google considers it in need of improvement. Anything over 4 seconds is considered poor.

    lcp scale

    So, pretty cut and dry. No need to wonder, you know exactly what is expected of you by the search giant.

    How to Improve Largest Contentful Paint (in WordPress)

    If you find that after testing that your site does not meet the above benchmark, fear not. We will spend the rest of this post talking about how to improve your Largest Contentful Paint value if necessary.

    The good news is that there is plenty you can do. On the other hand, many factors can influence LCP, therefore, correcting it is often not a quick fix thing. You need to look at the entire page loading process step by step. So let’s do that, shall we?

    Find the Largest Contentful Paint Element

    The first step in making your LCP value better is to find out what exactly your LCP element is. After all, how can you improve the delivery of something if you don’t know what to focus on?

    If you are using PageSpeed Insights to measure your site, it will actually tell you what’s your LCP element further down the page in the Diagnostics section.

    lcp element in pagespeed insights

    If you run a Performance test in Chrome’s browser developer tools, it will also show up in the timeline and even highlight the LCP element on the page. Click on LCP and then hover over the file under Related Node.

    find lcp element via chrome developer tools

    Break Down the Loading Process Into Parts

    Next up, in order to optimize your Largest Contentful Paint, it helps to divide the process into several phases. As mentioned above, there is no one-size-fits-all approach. You have to look at it from different angles to find out what needs fixing on your site. The phases proposed by Google are:

    • TTFB – Means “time to first byte”, as in the time from a user requesting the page until they receive the first byte of HTML.
    • Resource load delay – The timespan for receiving the page files (HTML and CSS) and before the LCP resources itself is loaded.
    • Resource load time – The phase in which the LCP resource loads.
    • Element render delay – Finally, the time between loading the LCP element and fully rendering it.

    Breaking down Largest Contentful Paint this way allows you to concentrate on the different phases and improve them individually.

    Optimize Site Hosting and Architecture

    These are measures to improve TTFB and resource load delay.

    How fast visitors receive you site data depends on a number of factors. For one, there is the server. Even if your site has a very small footprint, such as a one page website, it can still be heavily delayed by a sluggish web server. Another factor are the components that your site consists of, such as its operating system, themes, plugins, etc.

    As a consequence, improving all of these factors helps optimize Largest Contentful Paint. Here’s how to do it:

    • Invest in quality hosting — As mentioned, the web server is a large factor and your hosting provider, therefore, an important consideration. Avoid shared hosting if you can and get a hosting plan according to your traffic. Plus, try to have your site on a server close to your audience.
    • Use high-quality themes and plugins — Make sure you get your site components from good sources so that you know they are well programmed, lean, and have good support. Use the minimum number of plugins to reduce HTTP requests on your site.
    • Keep your site updated — WordPress core and plugin/theme updates come with improvements, including performance fixes. Stay on top of them in order to get the latest and greatest.

    With these in place, you can make sure that visitors receive your site data as quickly as possible. In order to know if your server is the problem, it helps to learn how to speed test your website. Also, avoid multiple redirects and look into the aforementioned server requests.

    Use a Content Delivery Network (CDN)

    Another way to improve time to first byte is to use a content delivery network (CDN). It helps to reduce the distance between the user and the place where they receive your website data from. This can make the loading time shorter.

    content delivery network cdn diagram
    Image source: Kanoha, CC BY-SA 3.0, via Wikimedia Commons

    There are even specialized CDNs where you only put your images on external servers, such as Jetpack’s Site Accelerator. This makes a lot of sense since images are often the largest contentful elements. CDNs also sometimes implement the image optimization techniques we will talk about now.

    Optimize Images and Web Fonts

    We are now getting to techniques to reduce the resource load time. If you paid attention earlier, you will know that that is the speed at which the LCP resource is delivered to the browser. An important consideration here are visuals.

    Images often end up the largest contentful object because they tend to be larger in size than text due to the surplus in information they carry. For that reason, one of the things you should focus on to reduce your resource load time is optimizing them:

    • Use the correct size — Only use images as large as they appear on the page, otherwise you are making visitors load more than they need. This often means resizing your images before upload or setting the WordPress media options exactly to the size you need for your layout. The regenerate thumbnails plugin can help you optimize the sizes of images already on your site.
    • Go for modern image formats — Not all image formats are created equal. To make your visuals as small as possible, use modern formats such as webp or avif, which have a smaller footprint than their predecessors.
    • Compress images — Compressing means removing unnecessary data. You can do this either before uploading your images (e.g. via TinyPNG/JPG or RIOT) or automatically with WordPress plugins like Smush or Optimole.
    • Lazy load images not on screenLazy loading means not loading images that aren’t visible in the browser yet. This can save lots of time. Just be sure to exempt images that do need to be visible immediately.

    More on this in our article on optimizing images. While you are at it, also reduce the size and number of your web fonts. Load only what really need and consider hosting your web fonts locally.

    Set Up Caching and Compression

    Caching and compression are both techniques to generally speed up your website by making your site files faster to load. They can help with both resource load delay and load time.

    The first one does it by pre-rendering your HTML documents and saving finished versions of them on your server so this process doesn’t have to be performed each time visitors want to see your site.

    wordpress caching schematic

    The second one means shrinking the size of your website files so that they are faster to transmit. You can do the latter either with Gzip compression or the newer Brotli compression. Combine it with minification for your files so that they take up less space and load faster.

    A plugin like Autoptimize or many WordPress caching plugins can do all of the above and are an easy way to improve Largest Contentful Paint on your site.

    Eliminate Render Blocking Resources

    Now we are getting to improving element render delay. Even if you have optimized your page loading speed and the delivery of your LCP element, your score will still be bad if the element itself takes a long time to show up on the page. Here, render-blocking resources are the most common culprit.

    You can use the linked article above for detailed instructions on how to deal with them. However, here a some short notes:

    • Load scripts asynchronously and inline essential JavaScript.
    • Inline style sheets into HTML (this only applies small style sheets, since inlined elements are not cached).
    • Reduce style sheet size by eliminating unused CSS and JavaScript. Alternatively, defer non-critical CSS and minify and compress style sheets.

    Use the Coverage tab in your browser developer tools to identify the elements that your visitors need to load first. It also helps you identify unused code that you may be able to remove.

    coverage data of unused css javascript in chrome developer tools

    Some Really Technical Stuff

    If you are of the technical persuasion, here is some more nerdy stuff you can do to further improve your Largest Contentful Paint in WordPress and beyond:

    • Preload images in HTML — Especially when used as CSS backgrounds or similar, add <link rel="preload"> to put priority on your most important images. This also works for fonts that could be needed to display the main text.
    • Adjust the fetch priority — Tell browsers what they should load first by adding fetchpriority="high". Limit this to one or two images, otherwise it defeats the purpose.
    • Use server-side rendering or prerendering — Especially if you have fast server. This reduces the amount of work needed to be done in the browser.
    • Optimize web fonts via font-display — Set the font-display rule to swap, fallback, or optional to keep your text rendering from being blocked during web font load.

    Largest Contentful Paint and WordPress in a Nutshell

    Largest Contentful Paint is just one of three metrics that Google considers as Core Web Vitals and uses to judge a website’s user experience and – ultimately – search rank. If you are struggling with site and search performance, it’s one of the factors to look into.

    In this post, you have learned how to figure out if this is a factor for your WordPress site, what LCP value to shoot for, and ways to improve it. Hopefully, by now you feel capable of changing your LCP for the better.

    As usual, you don’t have to be perfect. Pick what you feel capable of, implement it, and take it from there.

    Do you have any additional tips regarding the Largest Contentful Paint metric and how to improve it in WordPress? Feel free to chyme in in the comments.

    The post Largest Contentful Paint (LCP) and How to Improve It in WordPress appeared first on Torque.

  • How to Modify WordPress Block Themes (JSON Beginner’s Guide)

    With the advent of the WordPress Site Editor (aka Full-Site Editing) and block themes, the way WordPress users have to think about how to modify their websites and themes has changed dramatically.

    These days, instead of style.css and functions.php, there is a new central file for block themes: theme.json. Plus, instead of CSS and PHP, you need to be familiar with a new type of markup to make changes to it. Its name is JSON.

    While that might sound scary, the good news is that JSON is actually quite approachable. With a bit of technical understanding and tenacity, it’s not that hard to understand and to start making theme changes by yourself.

    To help you get there more quickly, this post is an absolute beginner’s guide to JSON and how to use it in WordPress. In particular, we will cover what JSON exactly is, which function the theme.json file fulfills in WordPress block themes, and how to use it to modify your themes.

    Take a deep breath and keep an open mind, it’s going to be fine, I promise.

    What is JSON?

    customize wordpress block themes json beginner guide

    Let’s start off with elephant in the room. What exactly are we talking about when we say JSON?

    You might have heard about it before, especially in connection with the WordPress JSON REST API. JSON, short for JavaScript Object Notation, is a lightweight data interchange format. That means, it’s a way to represent, store, and exchange data between different systems, applications, or platforms.

    There are other such formats out there, such as XML or CSV. However, what’s special about JSON and the reason why it has become so popular in recent years is that it’s not only easy for machines to parse and generate but also for humans to read and write. More on that below.

    Although it originated from JavaScript, JSON has become a language-independent format. Most programming languages now have built-in support or libraries for parsing and generating JSON data. That’s also one of the reasons why it is widely used in web applications and APIs for data transmission.

    Basic JSON Syntax

    As mentioned earlier, JSON is actually quite simple. It basically shows data in key-value pairs, meaning it gives you the name of something and displays what value it has, such as "color": "#ffffff". If you have ever worked with CSS, this type of format should look very familiar.

    Aside from that, JSON markup has the following features:

    • Keys are strings, meaning words, and the value can be a string, number, boolean (true or false), null, array (meaning, a list of values), or another JSON object.
    • JSON objects are delimited by curly braces (“{}”) while arrays use square brackets (“[]”).
    • Keys and string values are enclosed in double quotes.
    • The data format is strict, and any deviation from the standard syntax will result in a parsing error.

    Already feeling lost? Let’s go over an example to make things clearer:

    {
    	"version": 2,
    	"settings": {
    		"color": {
    			"palette": [
    				{
    						"color": "#ffffff",
    					"name": "Base",
    					"slug": "base"
    				},
    				{
    					"color": "#000000",
    					"name": "Contrast",
    					"slug": "contrast"
    				},
    			],
    		},
    	"styles": {
    		"color": {
    			"background": "var(--wp--preset--color--base)",
    			"text": "var(--wp--preset--color--contrast)"
    		},
    	}
    }

    The above first defines a version of a file. It is divided into a settings and styles section, both of which define certain colors. In the settings part, the colors are assigned to a subcategory palette and displayed as an array containing several colors as well as values called name and slug.

    The styles segment defines two colors, one for background, one for text. Both are only specified as variables. You can see that all the formatting mentioned above applies and how it’s easy to understand which keys and values belong together.

    Is that at all understandable? Because it it is, the good news is that the example above is taken directly from WordPress. So, if you feel like that wasn’t impossible to understand, you are ready to start using JSON to modify WordPress block themes.

    What is the WordPress theme.json File?

    Ever since the introduction of Full-Site Editing/the Site Editor and block themes, there is a technology shift going on in the WordPress platform. Instead of CSS and PHP, it is increasingly relying on JavaScript and JSON to get things done.

    The best example for that is theme.json. It’s a configuration file for block themes that helps to manage global styles and settings. It allows theme developers to define default styling, options, and configurations for the entire site and single blocks across the theme.

    theme.json file in theme directory

    That way, theme.json can change both how the theme looks and what options are available for users to make their own changes. This gives you a single, central way to build and modify block themes, especially since anything you configure here applies to both the front end of your site and the WordPress editor in the back. What’s more WordPress will read the markup in the file and create the necessary CSS styling for you.

    Before, the editor and website front end used different style sheets that you had to maintain separately. In addition, theme developers offered settings in different ways, even when using the WordPress Customizer.

    Now, with the new, unified approach, users will have a more congruent experience.

    Of course, as the file ending suggests, theme.json is written in JSON. As a consequence, if you want to learn to work with it and block themes, you need to be familiar with the markup that it is written in. That’s what we’ll do in the rest of this post.

    How theme.json Is Structured

    theme.json file has three main parts: settings, styles and custom templates/template parts. Here’s what you can control in each section:

    • Settings — Contains global styles, meaning available color palettes, font families and sizes as well as other text options, theme widths, spacing, and borders. Basically, the fundamental controls to change your theme’s look. It can also do the same for individual blocks and you have the ability to set custom CSS variables.
    • Styles — Here, you define the default styling of the theme, meaning the default values it should use for many of the options mentioned above. For example, you can set the theme background color and font families it will use for headings and body text. Again, the same is possible for single blocks. This is basically what style.css used to do.
    • Custom Templates and Template Parts — Where you define the page templates and template parts that will be available in your theme and point the theme to the accompanying HTML files.

    Using JSON to Customize WordPress Block Themes

    To give you a better understanding how this is relevant to modifying WordPress block themes, let’s go over a number of practical examples.

    Loading Local Custom Fonts to Change Theme Typography

    The first thing we are doing is load some font files placed on the server to introduce a different kind of typography to your theme. We have a detailed article on that topic, in case you want to see more details, so here is a slightly shorter version.

    The options for that are located in theme.json under settings > typography and then under fontFamilies.

    {
    	"version": 2,
    	"settings": {
    		"typography": {
    			"fontFamilies": {
    					
    			}
    		}
    	}
    }

    In block themes, you add new fonts using these values:

    • fontFamily — This is the name of the new font as it will appear in the CSS markup. It can include fallback fonts.
    • name — The font name that will appear in the WordPress editor.
    • slug — A unique identifier that WordPress uses to create the custom CSS property.
    • fontFace — This corresponds to the CSS @font-face rule. It is the part that really enqueues the font.

    In order to work, fontFace needs to include several other pieces of information:

    • fontFamily — The name of the font once more.
    • fontWeight — A list of available font weights separated by spaces.
    • fontStyle (optional) — You can set the font-style attribute here, e.g. normal or italic.
    • fontStretch (optional) — For example, for font families that have a condensed version.
    • src — Path to the local font file.

    Here’s an example of what that looks like:

    {
    	"version": 2,
    	"settings": {
    		"typography": {
    			"fontFamilies": [
    				{
    					"fontFamily": "Advent Pro",
    					"slug": "advent-pro",
    					"fontFace": [
    						{
    							"fontFamily": "Advent Pro",
    							"fontStyle": "normal",
    							"fontWeight": "400",
    							"src": [
    								"file:./fonts/advent-pro-v20-latin-regular.woff"
    							]
    						},
    						{
    							"fontFamily": "Advent Pro",
    							"fontStyle": "italic",
    							"fontWeight": "400",
    							"src": [
    								"file:./fonts/advent-pro-v20-latin-italic.woff"
    							]
    						}
    					]
    				}
    			]
    		}
    	}
    }

    Note that you can include several font files in fontFace, e.g. to load different styles. As mentioned earlier, you need to separate them with curly braces and a comma to do so.

    For a way to add local Google fonts to your theme without manually changing the markup, you can also use the Create Block Theme plugin.

    configure theme fonts with create block theme plugin

    Modifying Hover and Focus Styles

    Next, we want to deal with how to modify hover and focus styles for elements like links and buttons in WordPress block themes. Note that this is not yet in WordPress Core at the time of this writing. If you want to take advantage of it, you need to install the Gutenberg plugin so that you can use the latest improvements and features.

    To make changes to hover and focus styles, can use the pseudo elements :hover, :focus, :active, and, for the outline property, :visited. The settings for this are located in themes.json under styles > elements > link or, alternatively, button.

    {
    	"version": 2,
    	"styles": {
    		"elements": {
    			"button": {
    			},
    			"link": {
    			}
    		}
    	}
    }

    Here’s how to define styling for your links:

    "styles": {
    	"elements": {
    		"link": {
    			":hover": {
    				"typography": {
    					"textDecoration": "none"
    				}
    			},
    			":focus": {
    				"outline": {
    					"width": "2px",
    					"color": "#111",
    					"style": "solid"
    				}
    			},
    			":active": {
    				"color": {
    					"text": "var(--wp--preset--color--secondary)"
    				},
    				"typography": {
    					"textDecoration": "none"
    				}
    			}
    		}
    	}
    }
    

    The above markup does the following:

    • It states that links should not be underlined when someone hovers over time with their mouse cursor.
    • In the focus state, it adds an outline that is two pixels wide, solid, and has the color code #111111.
    • When active, the link text takes on a color defined by a CSS variable and, again, is to set to have no text-decoration value.

    Modifying Block Theme Colors

    In this example, we want to introduce a custom color palette and also disable the option for users to make their own color options. You would do this, for example, to make sure that everyone on your website can only use approved brand colors and not introduce something else to your website design. We will also go over how to add colors to specific blocks or elements so that you can predetermine what they look like.

    Understanding Standard WordPress Color Settings

    wordpress site editor default color options

    To do this, you first need to know what color palettes are available in Gutenberg by default. These are:

    • WordPress default color palette — This is always available. It provides colors that will prevail even at a theme switch. That’s why they are used for block patterns.
    • Theme color palette — Ships with the theme and is custom to which theme you are using.
    • User color palette — Colors added by the user via the available color picker. You can define them in the global styles under Colors > Palette.

    One or several of these always appear when accessing the color options for any of the blocks or global styles.

    Eliminating Color Options

    Let’s first hide the default color palette and gradients. You can do this under settings and color like so:

    {
    	"version": 2,
    	"settings": {
    		"color": {
    			"defaultPalette": false,
    			"defaultGradients": false
    		}
    	}
    }

    Like many other options, it’s also possible to do this for single blocks. For example, here it is for the heading block:

    {
    	"version": 2,
    	"settings": {
    		"blocks": {
    			"core/heading": {
    				"color": {
    					"defaultPalette": false
    				}
    			}
    		}
    	}
    }

    In addition, you can disable the custom color picker, so that website users won’t try to create and use their own colors.

    {
    	"version": 2,
    	"settings": {
    		"color": {
    			"custom": false,
    			"customGradient": false,
    			"defaultPalette": false,
    			"defaultGradients": false
    		}
    	}
    }

    If you input the above markup, all the usual color options will not be available, except for the theme colors.

    reduced color options in site editor

    Adding a Custom Color Palette

    Next, we want to add our own color palette. We do this in the same place in theme.json by adding a palette key and then adding an array with the slug, color, and name for each of the colors you want to include.

    {
    	"version": 2,
    	"settings": {
    		"color": {
    			"palette": [
    				{
    					"color": "#1B1031",
    					"name": "Base",
    					"slug": "base"
    				},
    				{
    					"color": "#FFFFFF",
    					"name": "Contrast",
    					"slug": "contrast"
    				},
    				{
    					"color": "#FF746D",
    					"name": "Primary",
    					"slug": "primary"
    				},
    				{
    					"color": "#551C5E",
    					"name": "Secondary",
    					"slug": "secondary"
    				},
    				{
    					"color": "#FB326B",
    					"name": "Tertiary",
    					"slug": "tertiary"
    				}
    			]
    		}
    	}
    }
    

    With this present in theme.json, you will find your own color options in the back end (and, in this case, also applied to your site).

    custom color palette active

    You can also do the same for gradients and duotones. In almost all cases you can use pretty much any CSS color declaration. Hex, RGB/A, color names, whatever you want, even CSS variables. Only duotones strictly take Hex and RGB color values.

    In addition, it’s possible to do the same for single blocks (be sure the names and slugs are different than in your sitewide settings):

    {
    	"version": 2,
    	"settings": {
    		"color": {
    			"blocks": {
    				"core/paragraph": {
    					"color": {
    						"palette": [
    							{
    								"color": "#1B1031",
    								"name": "Block base",
    								"slug": "block-base"
    							},
    							{
    								"color": "#FFFFFF",
    								"name": "Block contrast",
    								"slug": "block-contrast"
    							},
    							{
    								"color": "#FF746D",
    								"name": "Block primary",
    								"slug": "block-primary"
    							}
    						]
    					}
    				}
    			}
    		}
    	}
    }

    Setting Default Colors

    Finally, let’s cover how to set default colors for blocks and page elements. Here’s how to change the background and text color of the quote block:

    {
    	"version": 2,
    	"styles": {
    		"blocks": {
    			"core/quote": {
    				"color": {
    					"background": "#222",
    					"text": "#fff"
    				}
    			}
    		}
    	}
    }

    As you can see, setting default colors happens under the styles section. Here, we are targeting the core/quote block under blocks and defining a background and text color. Here is what it ends up looking like on the page:

    custom quote block style on page

    By the way, if you want to find out what other settings you can tinker with in theme.json, refer to the developer handbook.

    Introducing Additional Theme Styles

    One of the best features of the Site Editor is that it offers style variations. These allow WordPress users to completely modify the look of their themes (colors, fonts, block styles) with the click of a single button.

    style variation enabled and visible in preview

    Twenty Twenty-Three comes with a whole bunch of them.

    How can you implement this in a theme? Simple, by including additional theme.json files.

    twenty twenty threee style variation files

    A few notes:

    • For WordPress to pick up the additional files, you need to place them inside a directory called styles inside your theme folder.
    • The extra files get loaded in addition to the main file and override the included styles. That means, you only have to include markup for what you actually want to change. This is similar to child themes.
    • You can name the new files whatever you want, as long as they end in .json. The Site Editor will automatically use the file name (without extension) as the display name in the back end. However, you can also include a custom name by adding "title": "[your preferred name]" at the top of the file.

    For example, here is the (shortened) content of one of the style variations that Twenty Twenty-Three ships with:

    {
    	"$schema": "https://schemas.wp.org/trunk/theme.json",
    	"version": 2,
    	"title": "Canary",
    	"settings": {
    		"color": {
    			"duotone": [
    				{
    					...
    				}
    			],
    			"palette": [
    				...
    			]
    		},
    		"layout": {
    			"wideSize": "650px"
    		},
    		"typography": {
    			"fontSizes": [
    				...
    			]
    		}
    	},
    	"styles": {
    		"blocks": {
    			...
    		},
    		"elements": {
    			"button": {
    				...
    			},
    			"h1": {
    				"typography": {
    					"fontSize": "var(--wp--preset--font-size--small)"
    				}
    			},
    			"h2": {
    				"typography": {
    					"fontSize": "var(--wp--preset--font-size--small)"
    				}
    			},
    			"h3": {
    				"typography": {
    					"fontSize": "var(--wp--preset--font-size--small)"
    				}
    			},
    			"h4": {
    				"typography": {
    					"fontSize": "var(--wp--preset--font-size--small)"
    				}
    			},
    			"heading": {
    				"typography": {
    					"fontWeight": "700"
    				}
    			},
    			"link": {
    				"typography": {
    					"textDecoration": "none"
    				}
    			}
    		},
    		"typography": {
    			"fontFamily": "var(--wp--preset--font-family--ibm-plex-mono)",
    			"fontSize": "var(--wp--preset--font-size--small)"
    		}
    	}
    }

    This is the theme.json for the “Canary” theme style. As you can see, it introduces new duotone and color palettes, adjusts the layout width, and adjusts font sizes. It also adjusts the styling for several blocks and elements like buttons, headings, and links. At the end, it also changes the general theme font size.

    All of this is enough to adjust the theme appearance quite dramatically:

    twenty twenty three canary style variation

    At the same time, the theme variation file does all of this in about 250 lines of markup, while the original theme.json of Twenty Twenty-Three is over 700 lines long.

    By the way, another option to create theme variations is to use the aforementioned Create Block Theme plugin. It has the possibility to export your current modified design as a variation to use on other websites.

    create style variation with create block theme plugin

    Changing the Styling of Individual Blocks

    We have already shown above how you can make changes to singular blocks. Just to formally mention it here more generally, you can modify singular blocks in settings and styles, each under blocks.

    {
    	"version": 2,
    	"styles": {
    		"blocks": {
    			"core/paragraph": {
    				"typography": {
    					"letterSpacing": "-0.019rem"
    					"textTransform": "uppercase"
    				}
    			}
    		}
    	}
    }
    

    Here is what the markup above looks like in action:

    custom paragraph styling visible on page

    It’s possible to target blocks via core/blockname, e.g. core/paragraph for the paragraph block. You can find the names of all of the core blocks here.

    Adding Template Parts and Templates

    The final thing we want to talk about in terms of modifying block themes via theme.json is the ability to add templates and template parts. You find those as options in the Site Editor when clicking on the WordPress logo in the upper left corner.

    access template parts and page templates in wordpress site editor

    Naturally, in order to show up in the theme, you need to register them somewhere, which is another thing that happens inside theme.json. The exact location is under templateParts and customTemplates. These are placed at the base level of the file, meaning the same as version.

    {
    	"version": 2,
    	"customTemplates": [
    		{
    			"name": "blog-alternative",
    			"postTypes": [
    				"page"
    			],
    			"title": "Blog (Alternative)"
    		},
    		{
    			"name": "404",
    			"postTypes": [
    				"page"
    			],
    			"title": "404"
    		}
    	],
    	"templateParts": [
    		{
    			"area": "header",
    			"name": "header",
    			"title": "Header"
    		},
    		{
    			"area": "footer",
    			"name": "footer",
    			"title": "Footer"
    		},
    		{
    			"area": "uncategorized",
    			"name": "comments",
    			"title": "Comments"
    		}
    	]
    }
    

    Each entry under templateParts takes three keys:

    • name — This is the name/slug of the file for this template part, e.g. if you input “small-header”, your file would have to be named small-header.html.
    • area — This matters so that the Site Editor knows where to assign each part. templateParts know three areas: header, footer, and uncategorized. If you don’t specify either of the first two, the template part will default to the latter.
    • title — This is the name of the template part visible in the editor, make sure it is descriptive.

    Objects under customTemplates also take three attributes:

    • name — Same as for templateParts. Needs to correspond to the name of the associated HTML file.
    • title — Also same as above, appears in the editor.
    • postTypes — An array of post types this custom template supports such as post or page.

    Custom templates and template part files need to be placed inside the templates and parts folders in the theme directory respectively. You need to build them out of block markup, which you can also do by creating them in the visual editor and exporting them. More information on that here.

    WordPress theme.json Generators

    block theme generator example

    If you want to create your own theme.json, below are some helpful tools to make the process quicker. They allow you to simply pick settings and styles from a visual user interface and then download or copy the corresponding theme.json file to your theme.

    Resources

    For additional information on JSON and how to use it in WordPress block themes, check out these resources:

    Ready to Modify WordPress Block Themes With JSON?

    Modifying block themes is very different than working with classic themes. Instead of functions.php and style.css, a lot of the work happens in theme.json and HTML files.

    This can be a bit intimidating at first, especially if you are not familiar with JSON. However, as you have probably seen above, the markup is quite simple to understand and get used to. It also offers a powerful way to make sweeping changes to the look and behavior of your theme.

    Hopefully, with the examples above, you feel capable of implementing some of them yourself.

    Have you modified your WordPress theme via JSON markup before? Please feel free to share your experience in the comments!

    The post How to Modify WordPress Block Themes (JSON Beginner’s Guide) appeared first on Torque.

  • WordCamp Europe 2023 – A Report: WordPress Next Generation

    Well, it’s June again and you know that means: time for a report from WordCamp Europe 2023! Like many others, I descended on Athens this summer to attend the annual WCEU convention. It was the second in-person WordCamp Europe since the pandemic after last year in Porto. Besides meeting old friends, making new connections, and general socializing, I came to learn what’s new in WordPress and listen to talks on different topics.

    wordcamp europe 2023 report

    The two main themes that dominated the discussion for me this year were artificial intelligence and the problem of bringing members of the younger generation to the WordPress sphere. Therefore, as I am trying to summarize some of my favorite talks this year, these topics will come up a lot.

    So, if you couldn’t make it to the convention yourself, fear not. Here’s a glimpse into what WordCamp Europe 2023 was all about.

    Opening Remarks: Why WordCamps Are Special

    Naturally, the event, which was located in the Megaron Athens International Conference Centre, started with opening remarks by the leads of this year’s WordCamp Evangelia Pappa, José Freitas, and Sjoerd Blom.

    wordpress global leads on stage

    They stressed the importance of WordCamps as an opportunity for bringing people together, building the community, and sharing knowledge with each other.

    (Case in point, one of the main things I learned this year was that the Gutenberg editor supports markup. That means, you can use ## to create an H2 heading, ### for an H3 heading and so forth. It’s a game changer. Thanks to Birgit Pauli-Haak for pointing that out to me!)

    This year, 2,862 people from 100 different countries registered for the event, 1,300+ of them first timers. Besides the usual three tracks, they could also attend workshops, WP Connect for community events, as well as the wellness that we have gotten to know from earlier years.

    wordcamp europe 2023 wellness track schedule

    Of course, what made it all possible were the 150 volunteers, many of which have been volunteering for several years in a row. In addition, the event couldn’t have taken place without the sponsors, which included 103 microsponsors from the community this year.

    As usual, the event was live streamed on YouTube, so if you want to rewatch any of the presentations, you can do so here:

    After that, it was time to dive right into the presentations.

    WordPress Performance: Community Perspectives

    community perspective on wordpress performance

    The first talk I attended was a panel discussion on WordPress performance. The panelists were Miriam Schwab (co-founder of Stratic, now Elementor), Thierry Muller (Software Engineering Manager at Google/Chrome), Rahul Bansal (CEO rtCamp), and Adam Silverstein (moderator). They discussed performance not just in terms of speed but also in terms of usability and user experience.

    AI and Website Performance

    One thing that they touched on was how artificial intelligence could help with WordPress performance. Here are some of the use cases they imagined:

    • AI could do all the actual optimization work, like image processing and compression
    • It could help with the last mile of performance that’s hard for humans to do, like shift around render-blocking JavaScript without breaking the website
    • Generally, AI could be better at contextually analyzing performance problems on individual websites and offer tailored advice

    Why Has WordPress Not Improved as Much as Other Platforms?

    Here, the panelists said that the first thing to keep in mind is that other platforms have control over their entire website stack, making it easier to introduce changes. That is simply not the case in WordPress, which has to account for many different setups. In addition, WordPress has legacy code to maintain for backward compatibility.

    As a consequence, WordPress is simply moving more slowly. However, in addition, there has been a lack of focus on performance so far. The problem was mainly outsourced to hosting providers.

    This is changing now. For the first time we have a WordPress performance team, which shows a shift in focus to the topic of performance, including environmental factors. So, WordPress will catch up but it takes a little longer.

    Finding a Balance Between Features and Performance

    What might help balance features and site performance, including for client work, is to treat performance as a feature in itself and tie it to ROI and business goals. Once a site has been published, the goal is for it to succeed on the web and user experience is very important for that. This includes non-front end parts, such as dashboards.

    Therefore, if you or you client is thinking of adding a feature, A/B test it against performance. If users fall off, it’s probably not worth adding the feature. You can also use this to demonstrate to clients that adding more functionality might be hurting their goals, e.g. that it reduces sales due to performance. User experience is the ultimate goal.

    create a/b test in visual web optimizer

    Going Beyond Performance, What is Your Dream for WordPress in 10 years?

    At this point, Miriam was the first to mention the need for making WordPress more attractive to young people. She brought her daughter to WCEU, who had never heard about WordPress. The platform unfortunately has a problem appeal to young people and getting out there.

    Probably one of the main problems here is user experience, especially for new users. A possible remedy for that could be better onboarding. For example, finding a way to capture user goals, then automatically create a website for them with the necessary tools as a good starting point.

    Other items on the wish list were better media management and optimization as well as video and image editing inside WordPress as part of content creation.

    WordPress Performance: Q&A

    The session ended with questions from the audience, which raised additional issues:

    • Admin performance — There was an important reminder to also look at the wp-admin interface when it comes to performance, which currently loads a lot of JavaScript libraries on every screen. The panelists also reminded the questioner that optimizing this is a matter of resources and that right now content creation and front end performance have priority. However, it’s not a question of if but when the back end gets its turn.
    • Modern image formats — Another question was about implementing modern image formats like AVIF or JPEG XL in WordPress. Moderator Adam Silverstein actually gave a talk on that at WordCamp US 2022 for those who want to learn more.

    Panel Discussion: AI in WordPress

    Another panel discussion that I attended was on the topic of AI in WordPress. The panel was made up of individuals whose companies already have AI tools and products out in the wild. Therefore, the discussion was about real and tangible examples of what AI is already used for in WordPress and not just theory.

    Here’s who took part in the discussion and how they are already using artificial intelligence:

    • Sujay Pawar (Brainstorm Force) — His company has developed an onboarding process using AI as well as other AI products.
    • Gabriella Laster (Elementor) — Elementor offers access to an AI model in their page builder plugin that can generate text, change the tone, translate content, and generate custom code. They are also launching an AI model for image creation and other tools for web creators.
    • Constanze Kratel (BigCommerce) — BigCommerce have been using AI to improve the developer process and for ecommerce.
    • Daniel Kanchev (Siteground) — Siteground uses AI internally and externally for translation, support, and content classification (i.e. spam). They are also working on getting AI to help with website creation.
    • Shane Pearlman (Liquid Web) –Shane’s company offers AI tools such as to build quizzes for the LearnDash plugin. He was also the moderator of the discussion.

    AI as an Assistant for Website Setup

    One of the biggest challenges in both website and content creation is the blank page. The panelists agreed that in order for AI to be useful for setting up websites, users need more than a prompt, they need choices. Collecting targeted feedback from users allows you to zone in on what they are trying to build.

    Another issue that AI raises for the WordPress sphere as a whole is how to get AI tools to suggest WordPress as a website building tool in relevant prompts. Having outstanding documentation that they can index as content is key here.

    chatgpt wordpress recommendation

    What Else Are You Using AI for?

    Among the panelists, one of the most frequent areas of application for AI was in support, both internally and externally. AI models can help support members, customers, and developers find the right information and provide targeted consumer assistance.

    Siteground also uses artificial intelligence in customer communication as a quick help guide. Users can select an AI model to answer their question, which accesses the knowledge base and generates a reply. If that isn’t enough, they can escalate to a human operator.

    All of the panelists stressed the necessity of proper feedback for training the AI. It’s important to both collect the right feedback and regularly test and review the answers the AI gives, not fully rely on user reporting. Another ways is to use AI as a copilot for support agents who can see its replies and provide feedback on them.

    Translating Websites Using Artificial Intelligence

    Another application for AI is in the area of translation. Here, too, it’s super important to train the models well. You need to provide them with the right terms and be prepared to improve the models over time. Plus, definitely have human translators at hand for checking and feedback.

    This also works for customer support in different languages. Here, keep in mind that the target isn’t necessarily native language proficiency. The AI only needs to be better than two non-native speakers trying to communicate in a common foreign language. Customers want their stuff fixed, they don’t need perfect speech.

    In the end AI can take you 80-90 percent there but you still need internal, human input to make it really good. The human touch is probably something that will always be required.

    AI for Media Creation

    AI can also really help streamline image production. For example, it can provide different color options for the same product photos, eliminating the need to have to photograph each item variation.

    product variation images example hm

    You might also be able to get different background images and settings or quickly localize banners. Overall, AI image generation is getting better quickly so we will see more variety and content soon.

    Accessibility and AI

    Another area that artificial intelligence will likely have a big impact on is accessibility. For example, it is already possible to feed Midjourney an image and have it describe its content for you. You can use that as an ALT tag or even have an AI automatically fill it in.

    edit alt tag in wordpress to improve on page seo

    In addition, AI might be able give you a checklist of what needs to be done to make your site more accessible and also propose ways to do it. This is something that would be great to have in WordPress Core.

    Search, Reporting, and Analytics

    There are already different models for improving search and reporting. In the future, AI could give you the ability to log in to your site or tools and simply ask for your desired information, such as top-selling products, etc.

    It might, at some point, even be able to implement the findings and act on results and feedback, such as adjusting product pricing. AI might even run tests and experiments and make recommendations from there.

    What Are You Hoping to See in the Future for AI in WordPress?

    The answers to this question varied:

    • Gabriella — The majority of the population have not adopted AI yet. It would be great to make it more accessible and help people get on board. In addition, currently we are looking for AI to make our lives easier. However, the next step is to think about how AI can help us do things that we have never done before.
    • Daniel — AI will soon help end users build their own websites. The next step is to have it work as an agent to help you run the rest of your business. AI could provide analysis and tips or you could give it a goal and it iterates on it.
    • Shane — Get AI into business intelligence tools and analytics. Get it to a point where you can just have a conversation. It could look at how things are going on your website and give recommendations for improvements. The next step is for it to organize your life, book appointments, and work as an assistant. Right now, we are in pure discovery phase. We don’t know what’s possible yet until we see it.
    • Constanze — Using AI for store optimization, automatic translation, and localization. Get sentiments and data from your community and aggregate it to propose improvements for your business.
    • Sujay — You use so many tools in business, it would be great to have one central tool that integrates with all of them and can simply answer questions.

    In short, we have exciting times ahead of us.

    Tomorrow’s Generation’s Perspective on WordPress

    This talk was given by Tycho de Valk who, at 16 years old, was the youngest speaker to ever be on stage at a WordCamp. He is also the son of Joost de Valk and Marieke van der Rakt (formerly Yoast), a support engineer at Yoast, and has his own web development agency.

    After doing a survey among people his own age, Tycho discovered that their awareness for and opinion of WordPress was not that great. His talk was about why that is and how to address this problem.

    tycho de valk tomorrows generations perspective on wordpress

    3 Reasons Why WordPress Fails to Appeal to Young People

    Tycho identified three reasons why WordPress is not popular among the younger generation:

    1. Its marketing does not focus on young people
    2. WordPress is hard to get started with
    3. The platform is not as appealing as its competitors

    To the first point, the social media platforms that WordPress is popular on are not the same as young people use. Gen Z is mainly on YouTube, TikTok, and Snapchat and listens a lot to influencers. WordPress does not take advantage of that.

    For example, Shopify does do marketing for young people. They had a cooperation with Mr Beast (currently the most popular YouTuber) who named a mountain in Antarctica after the platform.

    mr beast mount shopify

    In addition, WordPress’ onboarding isn’t great, competitors are much better at this. Case in point, Shopify and Wix will both help you set up your site, in WordPress users are mostly left to fend for themselves.

    Finally, WordPress is not that flashy, it doesn’t look as modern as its competitors. In Tycho’s survey, 75% of respondents liked the Wix or Shopify interface better.

    How to Address These Issues

    Fortunately, there are ways to address these problems. For one, better onboarding experiences already exist in the WordPress sphere such as Woo Express or Extendify. That shows that it’s possible to improve in this area. In addition, shifting the focus to social media for young people and collaborating with influencers are also within the possibility of the WordPress sphere.

    wordcamp europe 2023 unicorn on stage

    Finally, to make WordPress more appealing to young people, the ecosystem has to work together. Unlike its competitors, WordPress is not one brand or one company. Therefore, the companies and people who make up the WordPress ecosystem have to come together and develop a unified marketing approach.

    WCEU Globals: The Future of WCEU

    The question of how to attract fresh blood into the WordPress sphere was also a central theme at another panel on Day 2. It consisted of WCEU global leads of the past years, specifically Jonas Andrijauskas, José Ramón Padrón García, Lesley Molecke, Taeke Reijenga, Rocío Valdivia, Bernhard Kau, and Tess Coughlan-Allen.

    the future of wceu panel discussion wordcamp europe 2023

    They got together to talk about the future of WordCamp Europe and existing challenges. Here is a summary of what they discussed plus answers to questions from the crowd.

    Bringing Younger People to WordPress

    WCEU can be a great portal for attracting younger users. To use it as such, we need to continue to be mindful about being open and inclusive for everyone.

    Another idea is to expand the offers for children and extend them to young people. We could train more people as caretakers and make kids feel welcome. That way, they get to know what an event is and get familiar with the community early on.

    In addition, the focus needs to shift from technical aspects to the possibilities WordPress offers, the ease of use, etc. We can also learn from a lot of brands that are present in higher education like Microsoft, Google, Cisco, etc. Maybe WordPress marketing could focus on schools and universities as well.

    Innovation for WordCamps

    Another topic that came up was the need to keep innovating. The format of WCEU has essentially stayed the same, we just added more things over time.

    One idea was for a new generation of WordCamps that are more specialized and niche. This could open up new topical areas and audiences.

    For that, it would also be possible to bring in people from outside WordPress to give presentations. Right now, WCEU is offering a mix of talks and workshops that cater to the largest possible audience. With more experimentation and focus on different niches and topics, the content could become more interesting.

    On the other hand, it also helps that WordCamps offer a wide variety and scope in terms of topics. Therefore, it might be a feasible idea to experiment only on one track or on a smaller scale.

    To find out more about this, the panelists invited everyone to answer the WordCamp survey. It provides important feedback and the organizers need community opinions and points of views to make decisions about WCEU.

    Variations on a Theme: 20 Years of WordPress

    Finally, one of highlights of WordCamp Europe is always the Q&A session with Matt Mullenweg. This year, he brought along both Matías Ventura and Josepha Haden Chomphosy.

    wordcamp europe 2023 keynote

    Important WordPress Updates

    The session started off with some updates from the WordPress sphere.

    For one, WordCamps are making a comeback. In 2022 there were only eight WordCamps in the first half of the year, now there have already been 25, more than in all of last year together. There is also a community summit happening in Washington DC, August 22-23, 2023 just before WordCamp US.

    wordpress community event

    Secondly, there was an update on Five for the Future, which was a big topic last year. There have been 727 more contributors, 95 more pledges, and 40 more company contributors.

    What’s more, OpenVerse is now on openverse.org and contains nearly 800 million images and audio files, which are also available in Gutenberg.

    openverse.org website

    Another big new addition is playground.wordpress.net, which allows you to run a WordPress instance online in the browser. You can use it as an instant development environment and even import it as an iframe.

    It even runs on your phone. You can find out more here.

    After that, Matias showed a video presentation about the progress of Gutenberg. You can find it below.

    Then it was time for the usual Q&A session, which brought up some interesting inquiries.

    How Do You Think We Can Work as a Community to Create More Diversity, Inclusivity, Variety, and Equality?

    There is still a long way to go. At the same time, there are also already initiatives out there that you can get involved in such as #WPDiversity.

    In addition, it’s important to listen to feedback from the community on how to provide more representation. It’s also something every single person can contribute to by welcoming everyone at WordCamps and building an open community.

    Gutenberg Has Great Tools Now But Is There Some Assistance to Use It Better, to Help Create Good Designs?

    The developers are experimenting with transformations where, if you select several elements, the editor could suggest patterns to you. AI could also be an option for this in the future.

    How Do You See Gutenberg and AI Coming Together?

    Matt said he has never seen things move as quickly as they are right now. Even Jetpack has an AI now but they are still figuring out the pricing, use cases, etc.

    He further said the two mega trends of the next 20 years will be AI and open source, which are highly combinable. AI will start building things and use open source to do so. Both are also very democratizing technologies, we all have access to them.

    It’s also important to keep in mind that the best things we are seeing now are the worst things we will see. In addition, the open source stuff is catching up really quickly.

    Back in 2016 the motto was to learn JavaScript deeply, now it is Learn AI deeply. In the future, it will likely be as important as literacy. So, play with it, explore the possibilities.

    Is There an Approximate Date for Gutenberg Phase 4 (Multilingualism)?

    Phase 3 will start properly after WordPress 6.3 comes out. It’s hard be certain about Phase 4, also because we don’t know where AI will be in terms of translation in five years. The fourth phase might be able to start in 2024.

    The reason for that is that multilingual is very very complex. For it to work, every single item in WordPress has to go from one-to-one to many-to-many relationships. This adds multifactorial complexity.

    It will be most difficult thing we will ever do in WordPress, therefore we need to do it right. It’s important to get the base layer in place, after that things will more easily fall into place. We probably need 18 to 24 months of Phase 3 before the developers can start looking into Phase 4.

    Do We Have Any Ideas or Plans for Official Mentorship Programs in the WordPress Community?

    One of the most helpful things for people to join the community is when they have someone to turn to. There is a trial program for that in Five for the Future that launches on July 12 where people in the program are asked to become mentors for others, especially from underrepresented groups. If you want to be a part of that as well, you can join here.

    wordpress mentorship pilot program

    Could We Have a Public View of Where in the Different Teams We Need More Support?

    We could consider adding dashboards on WordPress.org that display metrics for the different teams. This would show where more help is needed.

    Can We Add Volunteer Badges to Profiles on WordPress.org?

    Yes, there are some ideas already in the works.

    Closing Remarks: See You in Turin, Italy!

    And then it was already over again. To be honest, no WordCamp has ever passed as quickly to me as this one. It seemed to happen in the blink of an eye.

    Here are some stats for the event. WordCamp Europe 2023 had 2,545 attendees from 94 countries and 658 contributors on Contributor Day. There were 102 speakers from 29 countries and posts from and about WCEU reached 23.2 million people. Of course, none of it would have been possible without the organizers, so a big thanks to them again at this point.

    wordcamp europe 2023 volunteers on stage

    If you want to help make WordCamp Europe even better, please fill out the feedback survey. Aside from that, WCEU 2024 will be in Turin, Italy. See you there, hopefully!

    Were you at WordCamp Europe 2023? What did you like/dislike the most? Let us know in the comments below!

    The post WordCamp Europe 2023 – A Report: WordPress Next Generation appeared first on Torque.

  • How to Add Widget Areas to WordPress (Block & Classic Themes)

    Widgets are a popular way to add extra functionality, features, and information to different locations of WordPress websites. They allow you to put anything from contact forms over calendars to lists of your latest blog posts on your web pages.

    However, in order to do so, you first need widget areas — at least in classic WordPress themes. These are special designated parts of WordPress themes where, if you add widgets to them in the back end, they will show up in the front end as well.

    Block themes using the WordPress Site Editor, on the other hand, no longer have widget areas. Here, adding widgets works very different than before, which is reason enough to cover this entire topic.

    In the following, we take a look at different ways to add widgets to your WordPress theme. We talk about how to use widgetized areas and create new ones in classic themes, as well as how to make widgets show up in your block themes.

    What Are Widgets and How Do You Use Them?

    Before getting to the more technical stuff, let’s first settle real quick on what we are talking about when using the term “widget” in relation to WordPress. If you are using a non-block theme like Twenty Twenty-One, you find their settings under Appearance > Widgets.

    wordpress widget menu

    This shows all the widget areas available in your current theme (here, it’s only the footer) and the widgets they contain. Everything visible here also corresponds to the front end of your website.

    wordpress widgets in footer on front end

    Typically, widgetized areas will be in the footer, sidebar, or header. However, you can also place them pretty much anywhere you want (as you will soon see).

    How to Display Widgets on Your Site

    The widget menu used to have a different user interface, but by now it has been converted to work with the block editor like the rest of WordPress. Therefore, you can use it like any other instance of the WordPress Gutenberg editor.

    Add blocks via the block inserter (the blue plus button in the upper left corner) or its smaller version in the widget areas. You can also remove blocks in the usual ways and change their look and behavior in the right sidebar.

    add and configure wordpress widgets

    The blocks you can use span the usual options. Paragraphs, headings, tables, images — anything is possible.

    Typically, widget areas are used for more dynamic sections where the information updates itself. You can still find those under the Widgets category in the block inserter.

    classic widgets in block inserter

    As you can see they include things like displaying archives and categories, a list of your pages or the latest posts and comments, RSS feeds, or a search bar. Don’t forget to click Update in the upper right corner so that any changes you make here become permanent.

    Alternatively, you find all of these settings also in the WordPress Customizer (Appearance > Customize) and then in the Widgets tab.

    widget management in wordpress customizer

    The advantage here is that you can preview how everything will look like on the page directly in the editor.

    Creating New Widget Areas in Classic WordPress Themes

    Ok, so far so good. We have settled on what widgets are and in which part of classic themes you can manage them.

    However, what if you are not satisfied with your choice of available widgetized areas? What if you would like to be able to add widgets in other locations of your theme?

    In that case, you have to create them yourself, which is what we will go through now.

    1. Register Your Widget Area

    Creating widget areas in a WordPress theme is a two-step process. The first step is to register them.

    You do that using the register_sidebar() function inside functions.php. It looks something like this:

    function ns_register_top_banner_widget() {
    	register_sidebar( array(
    		'name'          => 'Top Bar',
    		'id'            => 'top-bar-widgets',
    		'description'   => 'Widgets in this area will appear in a bar at the top of the site.',
    		'before_widget' => '<div id="%1$s" class="widget top-bar-widget">',
    		'after_widget'  => '</div>',
    		'before_sidebar'=> '<div id="top-bar">',
    		'after_sidebar'=> '</div>',
    	) );
    }
    add_action( 'widgets_init', 'ns_register_top_banner_widget' );

    Note: Like many theme changes, you’d be advised to implement this in the form of a child theme.

    Some explanation of the different parts of the code snippet and what they mean:

    • name — This is the name of the widget area that will appear in the WordPress back end.
    • id — You need to give the widget area an id so you can display it later.
    • description — This used to show up inside the Widgets menu. You can use it to, for example, explain the location of the sidebar to other users. However, it will only appear for WordPress versions not using the block editor for widgets, so you can also omit it.
    • before_sidebar and after_sidebar — These two parameters allow you to add HTML markup before and after the widget area. That way, for example, you can wrap it in a <div> container.
    • before_widget and after_widget — Same as above but for any widget that appears in this area.

    There are other parameters you can use with register_sidebar(). You can learn more about them in the documentation. However, for our purpose, the above is enough.

    Once present in functions.php and with the file saved, the widget area will already show up in the WordPress back end.

    new widget area in wordpress back end

    2. Outputting Widget Areas in Your WordPress Theme

    While you can already see the widget area in the dashboard, currently putting any blocks or widgets in there will have no effect. That’s because there is not yet any markup that tells the theme to output whatever you add to it.

    This happens via the dynamic_sidebar() function. For example, to output the widget area that you created above anywhere in your theme, you can use this function:

    <?php dynamic_sidebar( 'top-bar-widgets' ); ?>

    Note how the code contains the same id as the widget area created earlier in order to display it.

    While the above works, it often makes sense to use a slightly more complex snippet:

    <?php if ( is_active_sidebar( 'top-bar-widgets' ) ) : ?>
    		<?php dynamic_sidebar( 'top-bar-widgets' ); ?>
    <?php endif; ?>

    The code above first checks if the widget area in question has any widgets in it and adds it to the page only if that is the case. It also contains some more markup like HTML classes and ids to make it easier to customize the output via CSS.

    That only leaves the questions, where do you put this markup?

    The answer: Anywhere in your theme files where you want the widget area to appear. Typically that is inside page template files like page.php or single.php. However, you can also add it to something like header.php or footer.php. To make a decision, it helps if you know the template hierarchy and understand how themes work.

    In this case, for the Twenty Twenty-One theme, we place it inside header.php right after the opening of the page.

    code to display widget area in header file

    With the code in place, when we now put a widget inside the newly created area, it will show up on the website in the intended place.

    widget content on page

    Alternative: Use WordPress Hooks to Display Widget Areas

    Instead of adding the code snippet directly to your page templates and theme files, you can also achieve the same output using WordPress Hooks.

    These are little pieces of code placed in strategic locations inside the aforementioned files that you can use to tell WordPress to execute functions in that very place without physically placing the code there. Instead, you can place the functions in question inside functions.php. Doing so has the benefit that it’s possible to manage all your widgetized areas from a single place.

    What would that look like for our case?

    Here’s how to place a widget area using a WordPress hook:

    function ns_output_top_banner_widget() {
    	
    	if ( is_active_sidebar( 'top-bar-widgets' ) ) :
    		dynamic_sidebar( 'top-bar-widgets' );
    	endif;
    }
    
    add_action( 'wp_body_open', 'ns_output_top_banner_widget' );

    The Twenty Twenty-One theme has a hook named wp_body_open() insider its header file. By hooking into it, we can display the widget area in the same place without modifying the file itself.

    As mentioned, the code snippet goes inside your (child) theme’s functions.php. This method is especially suitable for themes that contain a lot of hooks, like the Genesis Framework.

    How to Add Widgets in Block Themes

    So far, we have only talked about how to create widget areas in classic themes. However, what about block themes, which – after all – will likely become the de-facto standard for WordPress themes.

    Here, because the Site Editor works very differently, you don’t really have widget areas. You will also notice that the Appearance > Widgets menu does not exist.

    missing widgets menu with block theme active

    However, you can still add widgets, content, and other elements to your theme using similar principles as above.

    Enter Page Templates and Template Parts

    The first thing to notice here is that you are a lot less constrained in your placement of widgets with the block editor. Since you are not limited to pre-configured widget areas, you can place any page element pretty much where you desire.

    However, you can still use blocks like widgets in classic themes by using page templates and template parts. Access them in your block via menu in the Site Editor on the left (click on the WordPress logo in the upper left corner to open it).

    templates and template parts in wordpress site editor

    This gives you a list of available page templates on your site. They usually range from page over archive templates to the 404 page.

    available page templates in site editor

    It’s similar to what you would find if you had a look at the theme files in a classic theme.

    Under Template Parts, on the other hand, you find templates for parts of your website like the header, footer, or comment section.

    available template parts in wordpress site editor

    Click on any of them to open in the editor. Alternatively, you can also make changes to your templates and template parts via the Template Editor. That is a slightly reduced version of the Site Editor that you can open via the normal page editor. Just open your desired page, click on the template name under Template, and then Edit template.

    edit wordpress page template from template editor

    You can also pick another template from the drop-down editor.

    Adding New Elements/Widgets

    If you know how page templates work, you probably understand that any changes you make here will affect not just a single page but every single piece of content on your website that uses the page template or template part. Therefore, any page elements that you add to them will appear everywhere on your site where those are active.

    For example, you can add a latest post widget to the footer template part.

    add latest posts widget to footer template part

    If you do, and save, it also appears on the front end of the website for every page where this template part is present.

    new widget in footer on website front end

    If you think about it, that’s not very different from how classic widget areas work. They are also simply a way to add page elements and content so that they are reproduced in the same place across your entire website.

    The only difference here is that there is no need to edit files. Instead, you can do all of it in the visual editor, WordPress creates and modifies the files for you.

    Creating New “Widget Areas” in WordPress Block Themes

    So, how do you create new widget areas in block themes?

    The answer is: You don’t really. However, the closest equivalent to it is creating new page templates and template parts. Doing so allows you to add content that will show up only in limited parts of your website.

    Let’s go over an example to make things clearer. Say you want to do the same thing we did manually on top. In the past, you would have to register a widget area and then add the code to output it. With the Site Editor, you can achieve the same thing. Only in this case, it’s much easier.

    One possibility is to create a new template part. For that, under the Template Parts menu in the editor, click the plus icon at the top.

    add new template part in wordpress site editor

    In the menu that appears, give it a name (for example, “Header with top bar”) and choose the type (in this case, Header, of course), then start editing. Populate it with any page elements, widgets, and content you need or desire.

    new template part with custom content

    When you are done, you still need to assign it to the page template that you want it to appear in.

    For that, go to that template (in this case, Home) and find the existing header. Click on it, then on the three dots to open its menu, and choose Replace header.

    replace header template part in site editor

    This will open a menu with available template parts and patterns on your site.

    insert custom template part into page template

    Pick the one you just created to input it, then save the page template. If you now go back to your website’s front end, you see your newly created header live on the page (and only there).

    new widget visible on website front end

    How to add New Widgets/Blocks

    The final question that remains when talking about how to create widgets and widget areas in block themes is how to add more widget choices. After all, by default, you are only limited to a handful of options. Luckily, there are different ways to add more.

    For one, you can install Gutenberg block plugins, many of which contain different widget blocks such as forms, maps, or carousels.

    In addition, you also have the possibility to install singular blocks with widget functionality. For that, first click on the block inserter inside the WordPress Site Editor.

    open block inserter in wordpress site editor

    Once open, enter a search term for the kind of block you are looking for in the field at the top. Besides any options already present on your site, the editor will also search the WordPress block directory and show fitting options.

    custom block search results

    If something sounds like what you are looking for, simply click on the block in question to install it on your site and insert it into the page in the current position. Place it in the page template or template part where you want it to appear and save. Then, admire it on the front end of your site.

    By the way, you can always remove singular blocks that you installed in the Plugins menu in case you don’t need them anymore.

    deactivate deinstall wordpress block

    Widgetizing WordPress Themes is Not That Hard

    Adding widgets and widget areas in WordPress is an important skill to display a wide array of features and information on your site. They help to make your site more interactive, informative, and usable.

    In classic themes, the approach to creating widget areas is a little more technical. You need a rudimentary understanding of WordPress file architecture and feel comfortable with a code editor and making adjustments to PHP code. In block themes, on the other hand, you can do the same with just your mouse cursor.

    What’s important to keep in mind is that the principles are the same, only the implementation differs. Now that you know how it’s done, use this knowledge to improve your site!

    What is a must-have widget that you like to place on your websites? Are you using a classic or block theme to implement it? Let us know in the comments!

    The post How to Add Widget Areas to WordPress (Block & Classic Themes) appeared first on Torque.

  • The WordPress Polyglots Team: Who They Are and What They Do

    As an open-source project, you are probably aware that the WordPress platform is built by a large, global network of volunteers. While the developers and designers often get the most attention, there’s a lot of effort going on in the background that’s just as essential — even if it doesn’t involve a code editor. In this post, we want to look at some of those unsung heroes: the WordPress Polyglots team.

    wordpress polyglots team

    In today’s interconnected world, language plays a vital role in bringing people together and bridging communication gaps. That extends to WordPress. As one of the most popular content management systems, it empowers millions of users worldwide to create and share content. However, its full potential can only be harnessed when it’s accessible to users from diverse linguistic and cultural backgrounds.

    This is where the Polyglots team comes in. By translating WordPress into multiple languages and making it suitable for different localities, they ensure that it’s usable for a global audience. Below, we’ll delve into who the Polyglots team is, what they do, and why their work is indispensable to the growth and success of the WordPress project and community.

    What is the Polyglots Team and What Do They Do?

    As mentioned, the WordPress Polyglots team is a group of dedicated volunteers (15,000 of them!) responsible for translating WordPress. They play a crucial role in the WordPress project by ensuring that the platform, its themes, and plugins are available in different languages. To better understand what they do, let’s start of with some definitions.

    Important Concepts and Terms

    There are two processes at work with offering WordPress in different languages: Internationalization (i18n) and localization (l10n).

    The first means making software like WordPress and its themes and plugins ready to be translated. This happens by encoding text (so called strings) in a way that you can provide alternatives for them in other languages.

    __( 'Previous page', 'twentyfifteen' )

    Translating these strings then is called localization. When both are in place, it makes it possible for users to use WordPress, themes, and plugins in their chosen language.

    In WordPress, available language versions are called Locales. They describe not only the languages themselves but also local dialects. For example, English (U.S.) is a locale as is English (U.K.). Same for things like Brazilian Portuguese, Argentinian Spanish, or Austrian German.

    There are more terms that are important to know, however, these will do for the moment. If you want to dive more deeply into the world of Polyglots, check the official glossary.

    How is the Polyglots Team Organized?

    The concept of locales is also important because it is one of the basic ways the Polyglots team organizes itself. There are different teams for different locales with their own team leads and organization to help with the day-to-day translation work.

    Each team also has their own so-called Rosetta site, which is where they take care of their locales. These are simply the localized versions of the WordPress project website, such as es.wordpress.org for the Spanish version.

    wordpress.org spanish version

    Here, users can find information about WordPress in their own language and also download the localized version of it . It’s also where locale teams organize their own translation efforts.

    Furthermore, there are various roles within those teams, such as:

    • Locale Manager – An admin role for a particular locale and Rosetta site. They manage and appoint translation editors.
    • General Translation Editor (GTE) – Can validate strings for all projects of a certain locale.
    • Translation Editor (TE) – Appoint new translation editors, and approve the work of first-time translators. Can also be focused on a single project.
    • Translation Contributor – Those are the volunteers who contribute translations. Their work is verified by Translation Editors.

    These different roles work together to ensure high-quality translations and maintain consistency across the platform. They are like user roles on a WordPress site and their capabilities apply to the translation platform. You can find more more details here.

    What Exactly Does the Polyglots Team Do?

    So, it’s clear that the WordPress Polyglots team works on making WordPress available in different languages. However, how exactly do they do that? What does their work encompass in particular?

    • Translate WordPress components – That includes WordPress core, default themes (the Twenty X series), BuddyPress, bbPress, the Rosetta sites, and certain plugins. In addition, Polyglot members can opt to translate any theme or plugin they want.
    • Create locale packages – The team works publishes locale packages for each language, which consist of translated strings. These packages allow users to install and use WordPress in their preferred language.
    • Set and maintain translation guidelines – The Polyglots team ensures best practices to maintain consistency and quality in translations. Their guidelines cover areas such as tone, terminology, and style, which help create a cohesive experience for users across different languages.
    • Community involvement – The team actively participates in various WordPress events, like WordCamps and Contributor Days. Here, they collaborate with other WordPress enthusiasts, share knowledge, and encourage more people to join their efforts.
    • Ongoing maintenance – They are publishing continuous updates and improve translations to ensure they stay current with the latest WordPress features and developments. This also includes addressing user feedback and fixing any issues that arise e.g. RTL (right-to-left) languages and design problems for certain language versions.

    So, if you are one of the many people who don’t use WordPress in English, you have the Polyglot team to thank for that.

    How Many Languages Have They Translated Already?

    As you can see from the Teams page, to this date there are 208 locales.

    wordpress.org translation teams page

    However, these translations are in different states of completeness. At the time of this writing:

    • 63 locales have their translation up to date (90%+ of the latest WordPress version translated). The rest is at least one major version behind.
    • 79 Locales have never released a language pack or don’t even have their own Rosetta site.

    Overall, it’s probably fair to say that there are around 70 locales where the majority of the WordPress interface can appear in the chosen target language. Note that we are only talking about translations of the latest version of Core here. It does not take into account themes, plugins, patterns, and other components.

    If you want more information about that, click on any Locale you are interested in on the main translation page.

    wordpress list of locales

    Why is Translation Work Like This Important?

    That leaves the question, why go through all the trouble? Why not simply leave WordPress in one language?

    Well, as of June 2020, over half of all WordPress installs are running in a language different than English. So, obviously there is a big need and market for translations. That’s why the work of the WordPress Polyglots team is critical for the WordPress project and community. In addition, there are several other reasons.

    Global Reach

    WordPress is used by millions of people worldwide. Providing translations in multiple languages makes the platform more accessible and user-friendly for a diverse, global audience. This helps WordPress maintain its position as a leading content management system.

    google trends wordpress vs joomla vs drupal april 2023

    Inclusiveness

    By offering WordPress in various languages, the Polyglots team ensures that non-English speakers can also benefit from it. Doing so fosters an inclusive and diverse community. This encourages participation from people with different backgrounds and perspectives, which ultimately enriches the WordPress ecosystem.

    Localization

    The Polyglots team not only translates the platform but also focuses on localization. That means, the content is culturally appropriate and relevant to the target audience. This enhances the user experience and makes WordPress more appealing to users from different regions and cultures.

    change wordpress language in user profile

    International Collaboration

    The team’s work helps bring together contributors from around the world who share a common goal: making WordPress available to as many people as possible. This international collaboration strengthens the global WordPress community and promotes knowledge exchange and learning.

    Plugin and Theme Developers

    Translating plugins and themes allows developers to reach a broader audience and increase their potential user base. This encourages more developers to create and share their work within the WordPress community. That, in turn, contributes to the platform’s growth and innovation.

    wordpress themes directory april 2023

    Increased Adoption

    By providing translations, the Polyglots team helps lower the entry barrier for new users. That makes it easier for them to adopt WordPress. As a result, the platform’s user base continues to grow, contributing to its overall success and sustainability.

    In summary, the WordPress Polyglots team plays a vital role in the growth and success of the WordPress project and community. It promotes accessibility, inclusiveness, and diversity through their translation and localization efforts.

    What are Their Plans for the Future?

    Like every other part of WordPress project, the Polyglots team is constantly working on how to contribute more to WordPress. You can find out more about that by following the blog or signing up to the monthly newsletter. The latter contains top news, discussions, and proposals from the Polyglots team and is also available on the website.

    At the moment, these are the main objectives:

    • Staying on top of new WordPress versions (two more releases are planned for this year!).
    • Improving and updating their translation tools and interface. They recently integrated DeepL and Chat GPT to make things faster and also want to make GlotPress available for normal WordPress users. They could send back translations from their site own as proposals.
    • Keep updating theme, plugin, and patterns strings for more complete translations.
    • Attend Contributor Days at upcoming WordCamps.
    • Do outreach to find more translators and locale teams, organize local translation events, keep improving their onboarding.

    As you can see, there is plenty to do and they can use all the help they can get. So, if you’d like to lend a hand, make sure to read the next section as well.

    How Can You Get Involved?

    Would-be WordPress translators have different ways of getting involved. The first step is to read the official handbook. It goes over important parts such as:

    • How translating WordPress works
    • How the Polyglots team collaborates, e.g. the main communication channels
    • What the duties of certain roles are
    • Guides for plugin and theme authors who want their work translated (or translate it themselves)
    • Frequently asked questions and more

    In addition, get familiar with the glossaries and style guides of your Rosetta site. You can also find them via the teams pages. From here, you may also get in touch with local translation teams.

    access team page of different translation teams

    In addition, join the Make WordPress Slack and participate in the #polyglots channel. You can find their meeting schedule in the sidebar of the main Polyglots page.

    polyglots team meeting time

    These channels are also available to ask questions at any time. Plus, there are Slack channels for certain languages and locales.

    After that, most things happen on the main Polyglots page. There is a chat blog where people can make requests to have their translations reviewed and become part of Polyglots. You will be using GlotPress for the actual translation, which you can learn about here.

    Alternatively, use your language and WordPress skills by taking part in your local support forum. Go to the locale site of a chosen language (e.g. de.wordpress.org) and then head to the forum and help other users.

    chinese wordpress support forum

    More details about how to get involved with translating WordPress here.

    The WordPress Polyglots Team: Making WordPress Work for Everyone

    The Polyglots team is one of those parts of the WordPress project that is not always visible but nevertheless indispensable. They make sure that users can take advantage of the platform in their native language which more than half of them do.

    They also ensure translation quality and keep an overview of the different language versions. Besides continually improving their processes, tools, and bringing more translators on board that is.

    It’s a tremendous effort and takes a lot of energy to do all of that. If you are looking for a way to contribute to your favorite CMS without coding knowledge, translating is a great alternative. You are welcome to join and help out.

    Let us know in the comments if you decided to contribute your own language knowledge to the Polyglots team. We’d like to thank you personally!

    The post The WordPress Polyglots Team: Who They Are and What They Do appeared first on Torque.

  • Gutenberg vs Classic Editor: 29 Reasons to Switch (Or Stay Put)

    In the world of WordPress, the Gutenberg vs Classic Editor debate is one of strong opinions. And for good reason. The block editor has revolutionized how people create content on the platform. However, it’s not without its drawbacks and controversy. And for some, the prospect of learning a new interface is highly unappealing.

    gutenberg vs classic editor

    You might be one of those people asking yourself whether you should switch from the Classic Editor to Gutenberg or stick with what you know. To help you make an informed decision, this post looks at key differences and features of the two editors and offer advice on which one is right for your website. Whether you’re a novice or experienced developer, by the end you’ll have all the information you need to decide which editor to stick with.

    Getting to Know Gutenberg: Key Features and Functions

    The main distinction between Gutenberg vs the Classic Editor is how content is structured. Rather than a singular long text area, Gutenberg breaks down content into blocks. These can be text, images, headings, or even widgets and theme parts.

    gutenberg editor user interface

    This setup gives users the ability to arrange content without having to use complex shortcodes or HTML markup. Everything is directly available on the page. In addition, the blocks are also easily rearrangeable.

    What’s also important to note is that Gutenberg blocks are built on the React Javascript library. This makes them highly customizable and extensible. Developers can use React to create custom blocks, as well as modify existing blocks to suit their needs. 

    Getting to Know the Classic Editor: Familiar Features and Interface

    If you’re looking for the comfort and familiarity of a tried-and-true editor, then look no further than the WordPress Classic Editor.

    classic editor user interface

    Its WYSIWYG interface is easy to understand, and its basic editing options are perfect for those who don’t need advanced features. Many users already know the system well after having used it over a decade.

    Another advantage of the Classic Editor is its compatibility with a wide range of plugins and themes. Since it has been the standard editor for so long, many extension were built with it in mind. 

    10 Reasons Why Switching to the Gutenberg Editor is a Good Idea 

    The Gutenberg editor offers a variety of improvements and advancements over the Classic Editor. It’s a great choice for users looking for a more advanced and customizable editing experience. Here are nine reasons why switching to the Gutenberg editor is a good idea.

    1. Enhanced Customization

    gutenberg block customization options

    Gutenberg provides more personalization possibilities than the Classic Editor. It gives you the opportunity to customize each individual content block without making use of custom HTML or CSS. This allows you to craft distinct and attractive web pages just with your mouse pointer.

    2. User-Friendly Interface

    With its intuitive and novice-friendly interface, Gutenberg allows you to easily add or modify your page content. Just click the + sign in the upper left-hand corner to select whatever type of block you’d like to insert. 

    add blocks via block inserter

    3. Versatile Block and Layout System

    Speaking of blocks, the block system in Gutenberg is dynamic and flexible. It allows users to create engaging and visually appealing content with less fuss. Instead of being limited to a word processor-esque editing style, you can flesh out full page designs from within the post editor.

    For example, you can create rich content elements like columns and publication-style layouts without the aid of plugins. Or, take this even further with block patterns, which allow you to create entire pages in minutes.

    gutenberg block patterns examples

    4. True What-You-See-Is-What-You-Get Experience

    Creating content in the Gutenberg editor is much more aligned to what the end product will look like on the page than Classic Editor. The styling of the blocks completely adheres to their look on the front end and Gutenberg also imports all other site styling. As a consequence, what you see really is almost exactly what you get.

    gutenberg content on site

    5. Mobile Editing Convenience

    Gutenberg has a mobile-responsive interface, making it easy to edit and create content on-the-go.

    gutenberg editor mobile view

    6. Advanced Media Handling

    Adding and managing both images and videos in your content has never been simpler. Their blocks can be arranged creatively around text without the traditional limitations of aligning before, with, or after text. You are also able to set image backgrounds and add effects to your media such as overlays or duotone.

    gutenberg image customization options example

    7. Built-in SEO Optimization

    Gutenberg has built-in SEO capabilities, enabling users to optimize their content for search engines more efficiently. For example, it’s easier to set ALT tags for images. The editor is also optimized for schema markup and page speed, both of which play directly into search engine ranking. Plus, all blocks arrange neatly to accommodate smaller screens.

    gutenberg blocks on website front end

    8. Improved Performance

    Gutenberg’s code base is optimized and lightweight, resulting in fast page load times and better overall performance. This is especially the case after updates were made in 10.1 that more greatly aligned the block editor with Google’s Core Web Vitals and reduced code bloat considerably. 

    9. Third-Party Block Support

    Gutenberg allows for third-party block integration. This gives users access to a more functionality right inside the same interface. There are plenty of Gutenberg block plugins for that. You can even install individual blocks from right inside the editor.

    install blocks on the fly in gutenberg

    Or you can create your own and build a truly custom experience for visitors.

    10. Accessibility and RTL Support

    Gutenberg has improved accessibility and RTL (Right-to-Left) support, making it more inclusive.

    gutenberg accessibility improvements announcement

    5 Drawbacks of Using Gutenberg

    Though the Gutenberg editor offers a lot of great features, it does have its downsides. Some of the drawbacks to consider before switching include the following.

    1. Compatibility Issues with Certain Plugins and Themes

    Gutenberg may not be compatible with plugins and themes that were developed for the Classic Editor. Consequently, this may cause issues with layout and functionality on existing sites, and can require users to find new alternatives or make changes to their setup.

    2. Learning Curve

    Gutenberg’s user interface can be quite intimidating for beginners. Especially those who are used to the more straightforward approach of the Classic Editor. It will take some time to learn how to make the most of Gutenberg’s features and functions. This is especially true for the Site Editor aka Full-Site Editing. So be prepared to put in some extra effort.

    site editor interface

    3. Limited Backward Compatibility with Existing Content

    Be aware that Gutenberg may not be fully compatible with content created using the Classic Editor. That means, you might need to invest extra time and effort into editing your current material.

    importing classic editor content into gutenberg

    Additionally, some of the formatting and layout options from Classic could potentially become unavailable when switching over.

    4. Stability and Performance Issues

    While there have been a lot of improvements in this area, Gutenberg is much more prone to crashing than its predecessor. One of the reasons is its heavy use of JavaScript that can really take a toll on browsers, especially on older machines.

    5. Potential Security Problems with Certain Blocks

    Due to being open-source, Gutenberg allows users to create and submit blocks; however, this can bring about potential security risks from untested or unreliable sources. It is critical for people utilizing these blocks to be mindful of where they come from. There is the possibility that hackers could take advantage of any vulnerabilities in them.

    7 Reasons to Stick with the Classic Editor

    Though Gutenberg offers some great features, many WordPress users prefer to stay with the Classic Editor. Here are some of the reasons why.

    1. Familiar Interface

    classic editor interface

    The Classic editor has been around for many years. It is, therefore, a familiar interface for those who are used to it. For some, that’s reason enough to just stick with it.

    2. Compatibility with Certain Plugins and Themes

    The Classic editor is compatible with a wide range of plugins, so you don’t have to worry about running into compatibility issues. This can be especially important for users who rely on custom plugins for their website and are not ready to update to Gutenberg just yet.

    Many themes are also optimized for the Classic Editor. Therefore, you don’t have to worry about any layout or functionality issues.

    3. Good for Quick Content Creation

    Because it has fewer bells and whistles, the Classic Editor is better suited for quick-and-dirty writing. Simply type up some text and input some images and you are ready to go. No need for extra steps of time-intensive per-block customization.

    quick content creation in classic editor example

    4. Stable and Well-Tested

    The Classic Editor has been the motor under WordPress’ hood for ages. It has been of service to a hundreds of thousands of users and millions of sites. Therefore, any issues or bugs have likely been discovered and resolved. This can make it a more reliable choice for those who don’t want to encounter any unexpected problems.

    5. Backward Compatibility with Existing Content

    Since the Classic Editor is what WordPress has always had, it is much more backward compatible with existing content than Gutenberg. It also doesn’t come with Gutenberg’s extra markup.

    <!-- wp:paragraph -->
    <p>Consectetur adipiscing elit.</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:image {"id":14,"sizeSlug":"full","linkDestination":"none"} -->
    <figure class="wp-block-image size-full"><img class="wp-image-14" src="https://localhost/test/wp-content/uploads/2023/03/view-of-the-world-from-space.jpg" alt="" /></figure>
    <!-- /wp:image -->
    
    <!-- wp:paragraph -->
    <p>Donec semper, orci ut porta semper.</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:heading -->
    <h2 class="wp-block-heading">Sed lorem leo elementum</h2>
    <!-- /wp:heading -->

    This means you don’t have to worry about spending extra time and effort editing your current material when switching over.

    6. Easier for Beginners

    For many beginners, the Classic editor is much easier to understand than Gutenberg. It’s a more straightforward approach and can be less intimidating as users learn how to use WordPress. It largely resembles standard word processing software.

    7. Extensive Keyboard Shortcuts

    One thing that the Classic Editor really has going for itself is the number of keyboard shortcuts it offers. You can easily turn a paragraph into a heading or change an h2 to an h3 with the push of a few buttons. No need to click around and make these changes manually.

    classic editor keyboard shortcuts list

    6 Downside of Using the Classic Editor

    The Classic Editor has a lot of fans, but it’s not without its issues. While there are a number of reasons to stick with it, there are also some drawbacks. Here are four reasons why you may want to consider upgrading to Gutenberg.

    1. Limited Design Options

    When compared to Gutenberg, the Classic Editor does not provide a wide array of design capabilities. It is more difficult to add columns, backgrounds, and other desired components. As such, it can be incredibly challenging to make your content stand out, especially for beginners without HTML and CSS knowledge.

    2. Not Very Aligned With the End Product

    While there have been improvements to align the look of content inside TinyMCE more closely with its appearance on the page (namely through Editor Styles) there still is a big gap between the two. As a consequence, you will have to preview what you are creating a lot more in order to get it right.

    classic editor vs page content

    3. Poor Media Handling

    Another drawback of using the Classic Editor is its media handling capabilities. It’s not very user friendly and only includes basic options for embedding. Contrast this with Gutenberg where you can easily add media, move it around freely, as well as greatly configure its appearance.

    4. Lack of Mobile Optimization

    The Classic Editor is not as optimized for mobile devices. That makes it more difficult for users to edit and create content on smaller devices. It can be a drawback for those who want to update their website while on the move.

    classic editor mobile version

    5. Less Powerful Editing Capabilities

    If you’re looking for a more nuanced and visually-appealing approach to content creation, the Classic Editor might not be your best option. It’s missing key features that allow users to craft dynamic pieces of work — content appears mostly as one big block. The editor also has fewer editing capabilities overall which can limit creativity when building pages or posts.

    6. Lack of Future Support

    Currently, if you want to keep using the Classic Editor, you can only do it via a plugin (or by using ClassicPress). And while the support for the plugin has been extended several times, the explicit goal is to phase out the Classic Editor and fully rely on Gutenberg instead. Therefore, if you have a site setup that runs on the older editor, you might find yourself without support at some point.

    classic editor support prolonged announcement

    Gutenberg vs Classic Editor: Will You Make the Switch?

    When pitting Gutenberg vs the Classic Editor, it’s important to note that both editors have their own set of advantages and disadvantages. They are also most suitable for different user groups. The best choice for you will depend on your level of experience, the type of content you create, and your website’s specific needs.

    After careful deliberation, Gutenberg provides a user-friendly block-based editing platform that grants loads of customization options to its users. The interface is intuitive and allows for a lot of multimedia control. Moreover, the design structure helps enhance SEO optimization. At the same time, there may be some compatibility issue regarding plugins and themes that could affect performance.

    In contrast, the Classic Editor is a trusted and well-known tool that has been with WordPress for years. Users often find navigating its basic interface to be instinctual. Despite its ease of use, it lacks Gutenberg’s superior design flexibility as well as more advanced editing capabilities. It’s also not clear how far into the future it will continue to be supported by WordPress.

    At the end of the day, it’s up to you to decide which WordPress editor is best for you. For beginners, the Classic Editor may be the better option, as it’s easier to understand and use. But for those who need more design options and powerful editing capabilities, Gutenberg is most likely the better choice.

    Where do you stand on Gutenberg vs the Classic Editor? Will you be making the switch from one to the other anytime soon? Or have you already? We’d love to hear your thoughts below!

    The post Gutenberg vs Classic Editor: 29 Reasons to Switch (Or Stay Put) appeared first on Torque.

  • Is WordPress Really Free? The Costs of Running a WordPress Site

    Is WordPress really free? One of the reasons the platform is the most widely used CMS in the world is that it’s open source. That means, anyone can use it for any purpose, without paying an upfront licensing fee. This fact has enabled hundreds of thousands of people with no development skills to run their own website. 

    But does that mean every website built with WordPress is free? No. While you can use the software powering it without paying a dime, there are still costs involved with getting a site online, and promoting it.

    For that reason, in this post, we talk about if and why WordPress really is free, what you have to calculate for if you want to get your WordPress website online, and ways to create an entirely free WordPress site.

    That’s a lot to cover, so let’s get going.

    Yes, WordPress Itself is Completely Free

    is wordpress really free

    WordPress as a software is open source and licensed under the GNU General Public License (GPL). That means its source code is available to the public to do with as they please. In detail, that means you are free to:

    1. Use and run it – You can use WordPress for any purpose, whether it’s for personal blogs business websites, or even to build mobile apps and as a headless CMS. There are no restrictions on how you utilize the software and no costs associated with it whatsoever.
    2. Modify WordPress to your needs – As an open-source software, you are free to play with the WordPress code to your heart’s content. This allows you to customize your website’s appearance and functionality, as well as create new features or fix any issues you may find. You can also build upon the system in any way you want.
    3. Redistribute it – You are allowed to share your modified version of WordPress with others, so they can use your enhancements or customizations. For example, there is a fork of WordPress called ClassicPress, which does not include the new Gutenberg block editor. Projects like this are possible because of the platform’s open-source licensing. The only caveat is that anything you distribute that is built on WordPress has to be distributed under the same GPL license.
    4. Study the software – Since WordPress is not a proprietary product, you may examine and learn from its code. You can even copy it and build something else entirely. This can help you better understand how the software works and improve your own coding skills.

    So, as you can see, WordPress as a platform really is free. The main reason for all of that is that WordPress isn’t owned by a single company. Instead, it is a community effort of volunteers who donate their time and energy to make it better.

    However, There Are Costs Involved With Running a WordPress Website

    While you don’t have to pay anything for WordPress itself, if you want to build, publish, and run a website with it, there are other costs that come into play. These can vary depending on your requirements and the services you choose. However, it’s not really possible to have a website online without paying anything – not even if its based on WordPress. Here’s a list of some common costs you need to calculate for.

    1. Domain Registration

    To make it reachable on the Internet, you’ll need a domain name for your website. That’s the URL users type into their browser to get to your site. Domain registration fees typically range from $5 to $20 per year, but the cost can be higher for premium or specialized domain extensions.

    namecheap search results

    2. Web Hosting

    To allow visitors to reach your WordPress website, you’ll need a hosting provider. That’s the name for companies that rent out server space to store your website files so others can access them.

    wp engine managed wordpress hosting provider

    There are various types of hosting available, such as shared, VPS, and managed WordPress hosting. They come with very different prices for their plans, from just a few dollars per month to a few hundred. It all depends on what you need and choose.

    3. Themes

    While there are many free themes available in the WordPress repository, you may want to invest in a premium one for additional features, functionality, or design options. Premium themes typically cost between $30 and $100, with some even more expensive.

    wordpress themes directory

    4. Plugins

    Again, there are many free options which often suffice for smaller to medium sites.

    plugin directory

    However, you may want to go for premium versions with more features or better support. Prices vary. They can range from a one-time fee to an annual subscription, usually between $20 and $200 or more, depending on the plugin.

    5. Security

    Security services or plugins protect your website from hackers, malware, and other threats. You should always have at least some solution for that in place. Prices vary here, too. Some offer free basic protection, while more comprehensive solutions may charge a monthly or annual fee.

    firewall as protection against ddos attacks schematic
    Source: Cloudflare

    6. Backups

    Regular backups of your website are essential to ensure that you can quickly restore it if something goes wrong. Some hosting providers offer backup services as part of their hosting plans, while others may charge an additional fee. You can also use plugins to manage backups, with some offering free options and others requiring a subscription.

    updraftplus wordpress backup plugin

    7. Developer/Designer Fees

    If you require custom development or design work, you may need to hire a professional developer or designer. The cost for these services can differ greatly depending on the complexity of the work and the expertise of the professional you choose.

    8. Maintenance and Support

    Ongoing maintenance, such as updating themes, plugins, and WordPress itself, is crucial for the security and performance of your website. You may want to invest in a maintenance plan or a support service to help with these tasks. Doing so can range from a few dollars to several hundred dollars per month.

    wpbuffs wordpress maintenance service homepage

    9. SEO and Marketing Tools

    To increase your website’s visibility and drive traffic, it’s crucial to invest in search engine optimization (SEO) or marketing. There are many SEO tools and plugins out there, which have different costs depending on the features and services you choose.

    wordpress seo plugin example

    So, How Much Are We Talking?

    Generally, if you go for free themes and plugins and learn to do a lot of the work on your website yourself, you can run a WordPress site for about $50-$100 a year. The more premium services, components, and extensions you go for, the pricier it gets. The sky’s the limit.

    On the other hand, when you get to the level where you spend a considerable sum on running and marketing your site, you are usually at the point where the income your website generates makes it worth it.

    Free Ways to Create a WordPress Site

    So, if WordPress is free, is there really no fashion to also run a website with no budget? Well, there are ways, however, they all come with a few caveats.

    Install WordPress Locally

    You can install WordPress on your local computer using certain kinds of software. These programs create a server environment on your machine that you can run WordPress on just like a real server.

    localwp local wordpress development tool homepage

    This option is primarily used for development and testing purposes, since your website will not be accessible to the public. For that, you would still need to invest in a domain and hosting. However, it is perfectly suited to learn about WordPress and how to use it to build websites without paying anything.

    If you would like to learn more about local installation, we have these articles for you:

    Get a Free Plan at WordPress.com

    You might be aware that WordPress comes in two different versions: the self-hosted version you can download on WordPress.org and then install wherever you want and the hosted version on WordPress.com.

    wordpress.com homepage

    The latter is more like an SaaS website service as you create an account and then the website is hosted and created for you. It’s still based on WordPress, however, you don’t have access to the server environment.

    WordPress.com offers a free, basic plan that allows you to create a WordPress website with a subdomain (e.g., yourwebsite.wordpress.com). However, the plan comes with limited features, storage, and customization options. You’ll also have WordPress.com ads displayed on your site, and you won’t be able to install custom themes or plugins.

    On the other hand, when using a self-hosted WordPress site (meaning you download the software from WordPress.org and install it on a server), you can do with it whatever you want. At the same time, you will have to pay for at least hosting and a domain name. But it gives you a lot more flexibility and control.

    Free Hosting Providers

    There are some free web hosting providers that allow you to install WordPress on their servers. There are also ways to get a free domain. For example, some free hosting providers also offer free subdomains (e.g., yourwebsite.provider.com) as part of their service.

    However, keep in mind that these offers often come with limitations, such as limited bandwidth, storage, or support, and may display ads on your site. Additionally, their performance, security, and reliability is almost definitely inferior to paid options.

    For that reason, while this is a possibility on paper, it is in no way suited for any serious or professional purposes. That’s also the reason we are not linking to any of them here.

    So, How Free is WordPress, Really?

    Part of WordPress’ claim to fame is its nature as an open source and thus free software for building websites. While the platform itself is indeed free of charge and offers numerous freedoms, there are still costs associated with running a WordPress site.

    These costs almost always include domain registration and web hosting but can also extend to themes, plugins, security, maintenance, and marketing. Running a website is a complex undertaking, so it’s only natural that you need to invest some money into it.

    Finally, although there are ways to create a WordPress site for free, they often come with limitations that make them unsuitable for professional purposes. To truly benefit from the power and flexibility of WordPress, it’s worth investing in the necessary components and services to ensure a high-quality, secure, and user-friendly website.

    What do you most enjoy about the freedoms WordPress offers? What do you think is absolutely worth investing to run a successful WordPress website? Let us know in the comments!

    The post Is WordPress Really Free? The Costs of Running a WordPress Site appeared first on Torque.

  • WordPress A/B Testing: How to Run Split Tests in WordPress

    Trying to come up with strategies for enhancing user engagement, boosting conversions, and achieving your business objectives can seem intimidating. It’s a lot of effort to stay on top of all the details. Thankfully, there is a way to streamline these efforts: WordPress A/B testing.

    A/B or split testing can help you improve the most important aspects of your site. It’s a great tool for optimizing your website performance and conversion rates.

    If you’re ready to take your WordPress website’s performance to the next level, we’ll show you how. In the article below you will learn what A/B testing is and why it matters. After that, we’ll guide you through setting up a split-testing plugin on your WordPress site and teach you how to run tests effectively. We’ll also pinpoint which elements it makes sense to test and provide clear insights into analyzing the results.

    So if all of that sounds good, read on. We have a lot of ground to cover. 

    What is an A/B Test?

    wordpress a/b testing

    A/B testing is a way to test different versions of a webpage or app against each to see which performs better. It helps to find out what users react to better and optimize their experience in the process. The ultimate aim? To maximize conversions.

    Users randomly see the variations over time and their behavior is monitored and analyzed for any disparities in performance. Ultimately the design variant with higher engagement rates will become your top choice.

    Before starting an A/B test, it’s essential to have a strong understanding of the expected outcomes and determine what exactly to test. Whether headlines, images, button colors or more – split testing provides insight into how individuals respond to changes on your website and will guarantee reliable results when done correctly.

    For accurate results, it is essential to conduct a thorough A/B testing process that involves the following steps:

    1. Articulate an exact hypothesis of what you are trying to assess.
    2. Generate two different versions of your web page.
    3. Randomly show both versions to users and carefully observe their behavior. Run the experiment for a sufficient sample size and duration in order to obtain reliable outcomes.
    4. Using data-driven insight, select the version which achieved better performance as your final design solution.

    Why Are A/B Tests Important for WordPress Site Owners?

    A/B testing is a crucial tool for people who desire to get the most out of their site. It enables you to assess how effective your content and design or app elements really are and test alternatives. This allows you to discover which works best in order to optimize conversions on your site.

    what is an a/b test
    Source: Wikimedia License: CC-BY-SA 4.0

    Testing is not only a great way to reduce risks associated with introducing major changes. It also allows you to trial different ideas and assess the effect that each possible change has on user behavior before making any substantial alterations.

    Running a split test also provides an opportunity for website owners to identify what works and what doesn’t. This allows you to adjust your strategy in order to get the most from your online presence. The best opportunity are pages with clear calls-to-action. Any page where the expectation is that visitors will perform a task, i.e. make a purchase, sign up for a newsletter, or fill in a form. Specifically, landing pages, contact pages, and checkout screens are the best candidates.

    technology that will change the internet anatomy of a landing page
    Source: Formstack

    To deliver the optimal experience for users and to maximize conversions, revenue and ROI, it’s essential to have an understanding of visitors’ behaviors and preferences. A/B testing provides you with this knowledge quickly so that you can implement changes accordingly.

    As you might’ve guessed, this sort of testing is essential for any website regardless of its size, complexity, industry, or niche. It’s an invaluable tool that all WordPress website owners should consider employing.

    Setting Up A/B Testing Plugin on Your WordPress Website

    Now that you understand the importance of A/B testing, it’s time to learn how to get started.

    1. Install the Visual Web Optimizer Plugin

    One popular tool for A/B testing on WordPress is Visual Web Optimizer. To use it, you’ll first need to sign up for an account on the company’s website. That’s where you’ll be configuring the majority of your tests.

    visual website optimizer homepage

    Sign-up is free and you get a 30-day trial for A/B tests. During the process, you will also have to define which website you are going to use the software for and be given the code to run Visual Web Optimizer on your site.

    code installation during vwo setup

    However, we want to integrate the tracking code another way. For that reason, once you’ve signed up, you’ll next need to install their plugin, which connects your account to your WordPress site.

    To do this, go to Plugins in the WordPress dashboard and click Add New. Search for “Visual Web Optimizer” and click Install Now then Activate.

    install visual web optimizer wordpress plugin

    The first thing the plugin will ask you to do is input your VWO account ID.

    You find this on the Visual Web Optimizer dashboard in the upper right corner. It’s simply a six-digit number. Enter the ID in the WordPress settings, save, and the plugin will take care of the rest.

    vwo account id on main dashboard

    Note that Visual Web Optimizer is not the only plugin available for A/B testing on WordPress. There are other options available as well, which we’ll cover in more detail at the end of this article. However, to give you an impression of the work involved, VWO is a good example.

    It also offers features like built-in analytics, visitor segmentation, and heatmap analytics. These can help you track and analyze the performance of your tests.

    2. Choose What to Test

    When launching your A/B test, it is essential to identify the website elements you wish to evaluate. As mentioned, these may include headlines, images, call-to-action buttons and layouts. To ensure the best outcome, it helps to prioritize testing changes to these components based on their anticipated effect and how easy they are to implement.

    It’s also essential to think about your site’s objectives and what you intend to accomplish through A/B testing. Remember that the tested changes should be based on a particular hypothesis rather than randomly selected. This is key for ensuring successful results from your experiments.

    3. Create a Control Version of the Page or Post You Want to Test

    Once you’ve identified what to run a split test on, create a control version of your page or post. This is essentially a base design that serves as the control. It allows you to compare it with other versions in order to measure changes accurately.

    Most often, the control version is simply your current website design without any changes that you want to test. Likewise, this will be the version that the majority of visitors will see. It will be the benchmark for the performance of the variations. In this case, we are using the design below.

    a/b test control version

    4. Create One or More Variations of the Page or Post

    After that, it’s time to set up one or more variations of the page or post in question. All of that happens on the Visual Web Optimizer homepage. When logged into your dashboard, go to Testing > A/B and then click Create an A/B Test to get started.

    create a/b test in visual web optimizer

    In the next screen, define the pages you want to run a test on (in this case, that’s simply the homepage).

    set up pages to run test on

    When you are done, click Next. VWO will then automatically open the defined URL in their visual editor where you can create the design variations. In this case, we want to do a simple thing: make the “hire me” button on the right side of the navigation menu stand out more. That’s very simple. You can just click on it and then choose Edit element to create the variation.

    edit page element with visual web optimizer editor

    This opens up the options menu for that element.

    editing options menu

    Here, under Styles, we can define a background color, adjust the font color, as well as change margin and padding. Here is the result:

    page variation for a/b split test

    When satisfied, click Next to finish the design part.

    Note: Make sure to only change one element at a time to ensure accurate test results. For example, if you want to test the effect of a new headline, create a variation that only includes the new headline. By limiting yourself to one change at a time, you will know exactly what variation made all the difference.

    5. Define Which Metrics to Track

    The next step is to define the metrics that you want to track for your A/B test. This can be clicks, page visits, form submissions, and a range of other events that you can set up. In this case, we set it up so that it tracks the clicks on any pages where the goal URL is the “hire me” page (except for from that page itself).

    create metrics to track during split test

    Once you have figured everything out here, it’s time to click Next again.

    6. Run Your A/B Test

    Now the real test starts. In the last step, you need to name your test and configure what portion of your website’s visitors are shown the control version, while the rest are shown one of the variations.

    finalize a/b split test setup

    This can be an even split, you can set up custom proportions, or have VWO automatically move more traffic to the variation that performs better. In addition, you are able to use less than 100% of your traffic for the test.

    Once you have made your decisions, click Create to get to the summary page. Check that everything is as you wish and then start running the test by hitting the Start Now button at the bottom.

    a/b test summary page

    From here, it’s simply a waiting game. Be sure to run the test for a sufficient amount of time to gather statistically significant data. How long that takes depends on the size of your sample and the difference in performance you want to detect.

    You can use the built-in analytics tools to track metrics such as click-through rate, conversion rate, and bounce rate for each variation. It also comes with over 20 different predefined segments you can use to further break down your test results. These include time of day, browser, location, and new vs returning visitors.

    a/b test results tracking page

    7. Implement the Winning Variation

    Once you’ve determined which variation performed the best, implement it on your live website. Continue to monitor the key performance indicators of the page to ensure that the positive impact lasts.

    It’s vital to recognize that A/B testing is not a sporadic event, but something that should be part of your regular routine. That way, you can provide the best experience for visitors and make sure your site copy and design is effective.

    Additionally, various elements like seasonality, user behavior, and traffic sources can have an impact on the results of these tests. This is why it’s generally recommended to run more than one test to ensure consistent and reliable outcomes.

    Lastly, it’s important to note that split testing is not a replacement for user research or usability testing. Rather, it’s a complementary tool that can help you make data-driven decisions and improve your website’s performance. It’s recommended to use it in combination with other user research methods. That way, you can gain a comprehensive understanding of your users and their needs over the long-haul.

    Other Plugins Worth Considering

    In addition to the Visual Web Optimizer plugin, there are several other options you can use for A/B testing your WordPress website:

    • Nelio A/B Testing: A WordPress plugin that allows you to run A/B tests on your website’s pages, posts, custom post types, and taxonomies. It includes features such as heatmap analytics, visitor segmentation, and conversion tracking.
    • Optimizely: This platform is a more advanced A/B testing tool. It allows you to run A/B tests on your website as well as apps and also offers features such as personalization, multivariate testing, and behavioral targeting.
    • Split Hero: Here’s another example of a platform that offers website testing and personalization. Split Hero comes with multivariate tests and redirect tests. It includes heatmaps, visitor segmentation, and conversion tracking.
    • AB Press Optimizer: This one can run both A/B and multivariate tests on your WordPress website’s pages and posts, as well as custom post types and taxonomies. It supports heatmaps, segmentation, and conversion analytics, too.
    • Icegram Engage:  A general engagement and testing tool. It offers A/B testing, funnel analysis, visitor segmentation, and heatmaps.

    It’s important to note that these are just a few of the options available. When running split tests, it’s recommended to research and compare different and plugins to find the one that best suits your needs.

    A/B Testing in WordPress is a Must for Future Success

    As a website owner, you can greatly benefit from A/B testing. It is an invaluable tool that allows you to compare various versions of your webpages and features. Doing so will help you discover how to improve your pages for increased click-through rate and conversion rates. And who doesn’t love that?

    Split testing allows you to make data-driven decisions about your website’s design and functionality. It can optimize the overall user experience, minimize bad decisions, and continuously improve your website’s performance over time.

    By regularly conducting A/B tests and implementing the changes that lead to the best results, you’ll be able to reach your goals more efficiently. And with the right tool or plugin, you can easily get started without huge upfront costs. A/B testing is a “must” for any website owner who wants to maximize their success.

    Do you A/B test regularly? If not, will you start now? Let us know in the comments! We’d love to hear your thoughts.

    The post WordPress A/B Testing: How to Run Split Tests in WordPress appeared first on Torque.