惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
O
OpenAI News
酷 壳 – CoolShell
酷 壳 – CoolShell
The GitHub Blog
The GitHub Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
D
Docker
F
Full Disclosure
AI
AI
罗磊的独立博客
博客园 - 【当耐特】
U
Unit 42
S
SegmentFault 最新的问题
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Palo Alto Networks Blog
博客园_首页
H
Help Net Security
量子位
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
F
Fortinet All Blogs
D
DataBreaches.Net
B
Blog RSS Feed
Webroot Blog
Webroot Blog
TaoSecurity Blog
TaoSecurity Blog
S
Secure Thoughts
爱范儿
爱范儿
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
C
CERT Recently Published Vulnerability Notes
Martin Fowler
Martin Fowler
Blog — PlanetScale
Blog — PlanetScale
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Securelist

Pressable

Pressable Achieves Secure Hosting Alliance Certification | Pressable How Pressable MCP Is Changing The Game For WordPress Agencies: A Live Breakdown With Matt Medeiros And Phill Clapham | Pressable April Product Update: Navigation, Organization, And Efficiency | Pressable White-Label WordPress Hosting For Profitable Agencies | Pressable A Guide To Client Onboarding For WordPress Agencies| Pressable WordPress Plugin Management for Agencies WordPress Maintenance Contracts For Agencies: A Complete Guide | Pressable 6 Essential SOPs For WordPress Agencies | Pressable Pressable MCP: Control Your WordPress Hosting With AI. | Pressable How Much Does WordPress Hosting Cost? WordPress Performance Budgets: Setting And Monitoring Goals | Pressable WordPress Automation With No Code Automation Tools | Pressable Implement Single Sign-On (SSO) In WordPress | Pressable How To Build A Real Estate Site On WordPress | Pressable Headless WordPress Showdown: Next.js Vs Gatsby | Pressable How To Automate White-Label WordPress Hosting With WHMCS | Pressable Developer Toolkit Update: Automation & UI Enhancements | Pressable How To Build A DXP Platform With WordPress How To Boost WordPress Agency Client Retention: 4 Strategies White Label WordPress Admin For Agency Clients Performance Testing For WordPress Agency Client Sites Performance Testing For WordPress: A Framework For Agency Client Sites How To Upload A Video To WordPress | Pressable How To Mitigate The Impact Of AI Scraper Bots On WordPress Sites WooCommerce ERP Integration: Automate Your Back Office WordPress Personalization: How To Display Tailored Content To Visitors | Pressable WooCommerce Conversion Rate Optimization: A Data-Driven Approach How To Price Your Online Course: WordPress Monetization Guide 7 Ecommerce KPIs You Should Be Measuring (and How to Optimize Them) WooCommerce Vs. BigCommerce: Which Is Best For Your Business Needs? | Pressable WooCommerce Performance Troubleshooting: Diagnosing Speed Issues Step-by-Step | Pressable AI Content Moderation Tools for WordPress: Fighting Back Against AI Spam WordPress Vs. Craft CMS: Which Is Right For Your Business Site? | Pressable Questions To Ask Before Migrating From Shopify To WooCommerce Outgrowing Squarespace? WooCommerce Can Help WordPress Automation: Google Docs To WordPress Workflow WooCommerce Subscription Strategies: How to Build Recurring Revenue for Your Store Is WordPress Easy To Learn? A Beginner’s Guide WooCommerce Database Optimization With Query Monitor | Pressable WPForms Vs Gravity Forms: Which WordPress Plugin Works Best For Growing Businesses? WooCommerce Vs. Shopify: Choosing The Right Platform The Best AI Chatbots for WordPress Rank Math Vs Yoast: Best WordPress SEO Plugin? 5 Ways AI For Ecommerce Boosts WooCommerce Sales | Pressable WordPress Cookie Consent: What Site Owners Need To Know | Pressable How To Optimize Your WooCommerce Store For AI Search | Pressable WordPress Local SEO: A Guide To Local Search For SMBs | Pressable How to Improve Your WordPress Site’s Search Experience WordPress vs. Substack: Find the Best Platform for Your Newsletter WordPress vs. Ghost: Comparing Open-Source Blog and Newsletter Solutions A Comprehensive Migration SEO Checklist For WordPress Drupal vs. WordPress: Comparing Open Source Content Management Systems How To Add Enterprise-Level Search Capabilities To WordPress Sites What Are WordPress Nonces And How To Use Them | Pressable How To Customize WordPress Without Breaking Your Theme | Pressable WooCommerce vs. Magento (Adobe Commerce): Which is Better for Your Online Store? Prepare Your WooCommerce Store For A High-Traffic Product Drop Tips On Building A Successful WordPress Sales Funnel | Pressable Best WordPress Integrations For Workflow Automation | Pressable WooCommerce Vs. Wix: WooCommerce Explained For Wix Users | Pressable How To Choose WordPress Lead Generation Plugins | Pressable GA4 For WordPress: Understanding Your Data | Pressable WordPress Accessibility for Visually Impaired Users WordPress Information Architecture For Businesses | Pressable How To Use WordPress As A Headless CMS | Pressable How To Use Composer For Modern WordPress Development | Pressable WordPress GitHub Workflows: Version Control Best Practices How To Evaluate A WordPress Plugin Before Installing It | Pressable Billing Clients For WordPress Hosting | Pressable Advanced WooCommerce Cart Abandonment Strategies | Pressable How To Perform A WordPress Security Audit | Pressable How Managed WordPress Hosting Reduces Ops Workload | Pressable The Ultimate Ecommerce CRO Guide | Pressable How to Set Up a Business Continuity Plan for Your WordPress Website How to Hire the Best WordPress Developer for Your Site Common Mistakes When Choosing A WordPress Host | Pressable Beaver Builder Vs. Elementor: Which Page Builder Is Better Streamlining Website Handoff With Managed WordPress Hosting How WordPress Agencies Build Recurring Revenue | Pressable How To Customize WooCommerce Product Pages | Pressable SEO Tip For Migrating Your WordPress Domain | Pressable When To Switch To Enterprise WordPress Hosting | Pressable WooCommerce PIM Tools For Growing Ecommerce Stores | Pressable Automating WordPress Security: Tips To Prevent Cyberattacks Integrating POS With WooCommerce | Pressable Scale Your WordPress: Automation Tips For Growth, Efficiency, And Reliability | Pressable How To Edit Your WordPress Database Safely | Pressable Boosting Conversions, Not Load Times: Performance-Focused A/B Testing of Landing Pages in WordPress WooCommerce Migration: Avoid Downtime and Data Loss With These Essential Tips How To Improve Core Web Vitals on Your WordPress Site How To Run Successful SEO Experiments On WordPress | Pressable Automated WordPress Website Backups | Pressable Grow Ecommerce Sales With WooCommerce Dynamic Pricing LearnDash vs LifterLMS: Which WordPress LMS is Right for You? What Is High Availability Hosting For WordPress? | Pressable Tips On Managing WooCommerce Traffic Spikes | Pressable What To Do When A WordPress Plugin Breaks Your Site Automating Agency Workflows With WordPress Webhooks How To Automate Tasks In WooCommerce With Action Scheduler Why WordPress Downtime Costs And Uptime Guarantees Matters WordPress Cleanup: How to Uninstall WordPress Plugins Without Breaking Your Site
How To Create Custom Gutenberg Blocks For Your WordPress Site
Obatarhe Otughwor · 2022-11-08 · via Pressable

Woman sitting holding a tablet with cup of coffee on top of table and man smiling behind looking at tablet screen

Ask Your Favorite AI

Copy the link to a markdown format of this article for ChatGPT, Claude, Gemini, or your favorite AI.

In case you’re late to the WordPress party, blocks are in.

WordPress continues to evolve and improve the Gutenberg experience, which leads many developers to ask if they should create custom Gutenberg Blocks.

In this post, we look at how custom blocks work, when to use them, alternative options for building your website, and how to build Gutenberg blocks.

What Are Custom Gutenberg Blocks?

Blocks are the basic unit for building pages and posts in WordPress. WordPress introduced blocks with the Gutenberg editing experience in 2018. WordPress includes many default content type blocks, including post titles, images, and galleries. Additionally, plugins also add their own blocks to your editing experience. For example, some of the most recent WooCommerce releases introduced new blocks to make it easier to add products and eCommerce functionality to any page or post in WordPress.

Creating a custom Gutenberg block enables you to utilize that block on any page or post on your site. For example, you could create a block that pulled and displayed customer testimonials.

If you’ve been reluctant to fully embrace blocks, you’re missing out. All of the latest WordPress features focus on improving the block editor experience. You’ll need to use blocks to take advantage of many of the recent and upcoming WordPress features.

Download our e-book on getting started with Full Site Editing to learn more about how you can use blocks to build and edit your entire site.

When to Use Custom Gutenberg Blocks

You can create a custom Gutenberg block when the existing block options don’t fit your needs and you can’t find a viable alternative with your plugins or themes.

Creating a custom Gutenberg block is usually not a beginner-friendly project. The two most common reasons to code your own custom Gutenberg blocks are when you’re developing a plugin or creating your own theme.

Building a block isn’t a project most people undertake for a single website unless it’s an enterprise-level project with a dedicated developer or development team. We’re sharing some alternative methods that may work better if you need a custom block for only one site.

Alternatives to Using Custom Gutenberg Blocks

Before you go through all the work of figuring out custom blocks, consider if one of these alternatives might work for you.

Block Patterns or Reusable Blocks

If you don’t need to pull in dynamic content and really just want a block to replicate a layout, use the new WordPress Block Patterns feature or Reusable Blocks instead. This option is beginner-friendly and can be accomplished with little to no code writing.

Patterns are like a mini-template you can use anywhere on your site. You can insert it onto a page and then edit it. Reusable blocks work in a similar way. The big difference is how they’re treated after you use them on a page or post.

A pattern is a starting point. Once it’s on a page, any modifications you make are unique to that page. If you change the pattern later on, it won’t change where it was already in use.

Reusable Blocks remain linked to one another. If you update the block, the changes will apply to every place you used that block.

Code Block

Use the code block to insert custom code on the page. Theme and plugin developers create custom blocks to use across multiple sites. If you’re working on a single site, you can probably accomplish the same goal in less time by adding a custom snippet of code. Both options require the same level of technical expertise.

The one case where it may be worth considering building your own custom block is if you’re a developer who wants to turn the site over to a client. The client might be able to work with your custom block utilizing the Gutenberg editor but would be totally lost trying to edit your code.

How to Create a Custom Gutenberg Block

You have two options for creating a custom Gutenberg block. You can code it yourself or use a block-creating plugin. Both options require some coding. You’ll want to brush up on web development basics before you give it a try.

Coding It Yourself

Building custom blocks requires development experience. If you like to stick to WYSIWIG editors and your heart races anytime you accidentally click on the show code option, this is not for you.

Creating custom blocks requires intermediate knowledge of HTML, CSS, JavaScript, and React.

Start by setting up your development environment and tools. You’ll need a WordPress environment, Node, NPM, and a code editor. After that, follow this tutorial on creating your first block from the official WordPress block editor handbook.

Using a Plugin

If you’re comfortable with HTML, CSS, and JavaScript but not ready to code everything from scratch, consider the plugin approach. Using a plugin to create custom blocks is a great option when you need a custom block for use on a single website.

The Genesis Custom Blocks plugin is the most popular plugin for creating custom blocks. You’ll create the block fields using the familiar WordPress interface. After setting up the fields, you’ll need to supply the template of HTML, CSS, JavaScript, and PHP to make the block work.

Even though it’s easier, it still requires some coding. The difference is you can do it all from your WordPress admin without setting up a local dev environment. The plugin also makes it easier to test and preview the block to make sure it’s working properly.

Whatever You’re Building, We Can Help

No matter how you build your site, with custom blocks, or if you’re a holdout still using the classic editor, you need a reliable host. Pressable is proud to be the place where WordPress works best for everyone from the solopreneur to the team of advanced developers.

Pressable offers an easy-to-use interface, top-of-the-line security, and blazing-fast speeds. With Pressable’s managed WordPress hosting, your site will be easy to update and simple for your customers to find and use.

Sign up today and start building your site or learn more about transferring an existing site. We’re happy to help you migrate your sites!

Obatarhe Otughwor

Obatarhe is a passionate WordPress enthusiast, dedicated community volunteer, and tech advocate with a proven track record of delivering exceptional customer experiences. With a background as a Product Expert at Google, he brings extensive technical expertise across various domains including WordPress support, remote technical assistance, and software development. Known for his empathetic approach and problem-solving mindset, Obatarhe consistently earns 5-star ratings by understanding each customer’s unique needs and providing thoughtful, tailored solutions. In his current role as a Customer Success Engineer, he excels in delivering personalized service that not only resolves issues effectively but also builds lasting customer trust and satisfaction. Beyond customer support, Obatarhe is skilled in Python, JavaScript/Node.js, PHP, Laravel, HTML, CSS, and Git. He has developed and deployed an election campaign tracking API using Node.js, hosted on Heroku and GitHub and also contributing to some WordPress plugin open source projects showcasing his ability to translate ideas into functional solutions. When he's not working, Obatarhe enjoys traveling and capturing breathtaking landscape photography—blending his love for technology and nature into a well-rounded lifestyle.