How to Add Custom Meta Boxes in WordPress Posts and Post Types

Featured Imgs 13

Do you want to learn how to create custom meta boxes for your WordPress posts, pages, and custom post types?

WordPress adds metadata to your content automatically, such as the publication date, categories, and tags. However, you may also want to add your own custom meta data.

In this article, we will show you how to easily add unique information to your content, by creating a custom meta data box in WordPress.

How to add custom meta boxes in WordPress posts and post types

What is a Custom Meta Box in WordPress?

When you create posts and pages, or custom post types in WordPress, that content usually has its own metadata. This metadata is information related to the content like date and time, the author name, title, and more.

You can also add your own metadata using the default custom fields box.

Adding custom meta boxes in WordPress posts

Pro Tip: Can’t see the Custom Fields box in the post editor? Then see our guide on how to fix custom fields not showing in WordPress.

The Custom Fields box is a good solution if you just want to add custom metadata to a few posts. However, if you plan to add lots of unique information to your content, then it makes sense to create a custom metadata box.

In fact, many of the popular WordPress plugins add custom meta boxes to the Edit screen for posts and pages. In the following image, you can see how easy it is to add SEO information to your post, using a custom meta box provided by AIOSEO.

The All in One SEO (AIOSEO) WordPress plugin

With that being said, let’s see how you can easily add custom meta boxes in WordPress posts and post types.

How to Add Custom Meta Boxes in WordPress Posts and Post Types

The easiest way to add custom meta boxes to WordPress is by using Advanced Custom Fields. This plugin allows you to attach all kinds of extra information to your posts and pages, and then show that data to visitors using a shortcode.

The first thing you need to do is install and activate the Advanced Custom Fields plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Create a Custom Meta Box

Upon activation, go to ACF » Field Groups and then click on the ‘Add New’ button.

Adding a custom field to your WordPress website

Here, you can create the custom fields that will appear in the metadata box.

To start, you’ll need to type a title into the field that shows ‘Field Group Title’ by default. This will appear in the WordPress content editor, and it will be used as the title of your meta box.

With that being said, you should use something descriptive, especially if you manage a multi-author WordPress blog or share the dashboard with other people.

How to easily add custom meta data to your website or blog

With that done, you’re ready to add the first field to your meta box.

Add Custom Fields to the Meta Box

To start, open the ‘Field Type’ dropdown and choose the type of field you want to add, such as Text, Date Picker, Checkbox, or any other field type.

Adding custom fields to the WordPress content editor

After that, type in a label for the field.

Advanced Custom Fields will show this label before the field, so it will help users understand what information they need to enter.

The Advanced Custom Fields WordPress plugin

Advanced Custom Fields will generate the ‘Field Name’ automatically, so you can leave this field empty.

With that done, you may want to type in a ‘Default Value.’ This will be added to the page, post, or custom post type automatically if the user doesn’t add their own information.

Adding default values to custom WordPress fields

You may see more options depending on the kind of field you’re creating. For example, if you selected ‘Image’ from the ‘File Type’ dropdown, then you can choose the image format.

Most of these options are self-explanatory so you can follow the onscreen instructions to configure the custom field.

When you’re happy with how the field is set up, click on ‘Close Field’ to collapse the section.

Adding custom data to a website or blog

You can now add more fields to the custom meta box by clicking on the ‘Add Field’ button.

Then, simply configure the field by following the exact same process described above.

Saving a custom field group

Add a Custom Meta Box to the WordPress Content Editor

When you’re happy with how the custom meta box is set up, you’ll need to define where and when the meta box will appear.

Scroll to the ‘Settings’ section and then click on the ‘Location Rules’ tab.

Controlling where custom content appears in the WordPress content editor

Advanced Custom Fields can add the box to all kinds of content. For example, you can show the meta box on specific post types, categories, taxonomies, navigation menus, and more.

Simply use the dropdown menus to choose where the meta box will appear in your WordPress dashboard. For example, if you accept guest posts then you may want to add the box to all posts in the ‘Guest Posts’ category.

Creating content rules using a WordPress plugin

After that, click on the ‘Presentation’ tab.

Here, you can choose the meta box style, where it appears on your WordPress blog, and where the label and instructions will appear.

ACF's presentation settings in the WordPress dashboard

If you plan to add multiple boxes in the same location, then you can change the order they appear in by typing into the ‘Order No’ field.

For example, showing the most important meta boxes towards the top of the screen may improve your editorial workflow.

If you’re unsure, then you can leave this field set to 0.

Reorganizing fields in the WordPress content editor

On this screen, you’ll also see a list of all the fields that WordPress usually shows on the post edit screen.

If you want to hide a field, then simply check its box. For example, if you’re using custom fields to create an author info box, then you may want to hide the default ‘Author’ field.

Hiding fields in the WordPress post editor

When you’re happy with the changes you’ve made, click on ‘Save Changes’ to make the field group live.

You’ve now successfully created a custom meta box for your WordPress post, page, or custom post type. Depending on your settings, you can now visit the post editor to see the custom meta box in action.

An example of a custom meta data box, created using a free WordPress plugin

Displaying Your Custom Meta Box Data in WordPress Theme

You’ve now successfully added a custom meta box to the WordPress dashboard. Any information users type into the meta box will be stored in the WordPress database when they save or publish the post. However, this information won’t appear on your website by default.

With that in mind, let’s make sure the custom metadata appears in your WordPress theme, so visitors can see it.

You can do this using shortcode or by editing your WordPress theme files.

How to Display Custom Metadata using Shortcode

Adding a shortcode in WordPress is the easiest method, and allows you to control exactly where the information appears on your website. For example, if you’ve created a ‘Star Rating’ field, then you can show this information after the post title, inside the content, in the footer, or anywhere else simply by adding a shortcode.

However, you will need to add a shortcode to every page, post, or custom post type manually. This can take a lot of time and effort, especially if you have a lot of content.

To get a field’s shortcode, go to ACF » Field Groups. Then, hover over the field group that you want to display and click on the ‘Edit’ link when it appears.

Editing a meta data field group

You’ll now see all the fields that make up this group.

For each field you want to display, make a note of the value in the ‘Name’ field.

How to show custom data in your WordPress theme using shortcode

With that done, go to the page, post, or custom post type where you want to show the custom metadata.

You can now click on the ‘+’ icon and type in ‘Shortcode.’

Adding shortcode to a WordPress page or post

When the right block appears, click to add it to your layout.

You can now add the following shortcode to the block, making sure to replace "article_byline" with the name of the field you want to show.

Adding custom meta data to a WordPress theme

You can now repeat these steps to add multiple custom fields to the post.

When you’re happy with the changes you’ve made, either click on the ‘Publish’ or ‘Update’ button. Now, simply visit your WordPress website to see the custom metadata in action.

An example of custom meta data, displayed using a shortcode

How to Display Custom Metadata by Editing Your WordPress Theme

If you want to show custom metadata in the same location on every page, post, or custom post type, then you can add code to your WordPress theme files.

This can save you time in the long-term, but it isn’t the most beginner-friendly method. You’ll also lose all the custom code the next time you update your WordPress theme, which is why we recommend creating a child theme. You can then add your custom code to the child.

If you haven’t edited your theme files before, then take a look at our beginner’s guide on how to copy and paste code in WordPress.

You’ll need to edit the file where you want to show the custom metadata. This will vary depending on your theme, but you’ll usually need to edit your site’s single.php, content.php, or page.php file.

Once you have the right file, you’ll need to add the code inside the WordPress loop. To find this loop, simply search for code that looks something like this:

	<?php while ( have_posts() ) : the_post(); ?>

You can then paste your code after this line and before the line that ends the loop:

	<?php endwhile; // end of the loop. ?>

As an example, your custom field code should look something like this:

	<h2 class="article-byline"><?php the_field('article_byline'); ?></h2>

Notice how we wrapped the code in a h2 heading with a CSS class. This allows us to format and style the custom field later by adding custom CSS to our theme.

Here’s another example:

<blockquote class="article-pullquote">
 
<?php the_field('article_pullquote'); ?>
 
</blockquote> 

When adding code to your theme, don’t forget to replace the field names.

With that done, you can visit any post where you’ve already entered data into the custom fields. You will now see your unique metadata in action.

How to add custom fields to a WordPress theme

We hope this article helped you learn how to add custom meta boxes in WordPress posts and post types. You may also want to see our guide on how to create automated workflows in WordPress, or see our expert pick of the best SEO plugins and tools that you should use.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add Custom Meta Boxes in WordPress Posts and Post Types first appeared on WPBeginner.

OceanWP Theme Review: An All-Rounder Free WordPress Theme

Best Wordpress Themes 1

OceanWP is an exceptional free WordPress theme that provides a diverse range of premium features, making it a superb choice for any website. Its stylish design and extensive functionality have garnered immense popularity among developers and users alike. Professional Appearance and Customization Options One of the standout features of OceanWP is its ability to provide […]

The post OceanWP Theme Review: An All-Rounder Free WordPress Theme first appeared on WPArena and is written by Editorial Staff.

How to Replace Default Theme and Plugin Editor in WordPress

Wp Plugins

Are you looking for a way to replace the default theme and plugin editor in WordPress?

The default WordPress theme and plugin editors are plain text editors with limited functionality. By replacing these editors with better tools, you can use advanced features like access control, child theme creation, file downloads, and more.

In this article, we will show you how to easily replace the default theme and plugin editor in WordPress.

Replacing the default theme and plugin editor in WordPress

Why Replace the Default Theme and Plugin Editor in WordPress?

The default theme editor in the dashboard of your WordPress website allows you to make direct changes to the code in your theme files.

Similarly, the plugin editor lets you edit the code of the installed plugins on your website.

Default theme editor preview

These built-in editors have text editor interfaces that lack advanced features like access control, file download/upload, and child theme creation. This makes it time-consuming for you to add and maintain custom code.

Plus, if an unauthorized person gains access to your WordPress admin area, then they can easily access the default editors to edit your theme and plugin files. This can allow them to install malware on your website.

By replacing these editors with a plugin, you can easily customize your WordPress themes and plugins from the dashboard by adding or removing code snippets, customizing colors, modifying various template files, CSS styles, and more.

This will allow you to make quick changes to your theme or plugin without accessing your website files via FTP.

You can also create child themes, control editor access to make your website more secure, and even upload files to your plugins and themes from your computer.

Having said that, let’s see how to easily replace the default theme and plugin editor in WordPress. You can use the quick links below to jump to the different parts of our tutorial:

How to Replace the Default Theme and Plugin Editors in WordPress

First, you need to install and activate the Theme Editor plugin. For detailed instructions, you can see our beginner’s guide on how to install a WordPress plugin.

Note: Before making any changes to your theme or plugin files, please make sure to create a complete backup of your WordPress website. This will come in handy if anything goes wrong and you have to restore WordPress from a backup.

Upon activation, you need to head over to the Theme Editor » Settings page from the WordPress admin sidebar.

Once you are there, check the ‘Yes’ box for the ‘Enable code editor for theme’ option.

After that, if you want to disable the default WordPress theme editor, then you need to check the ‘Yes’ box next to the ‘Disable WordPress theme file editor?’ option.

Configure theme editor settings

Once you have done that, just switch to the ‘Plugin Editor’ tab at the top.

Here, you need to check the ‘Yes’ box next to the ‘Enable code editor for plugin’ option.

You can also disable the default editor by choosing the ‘Yes’ option for the ‘Disable WordPress plugin file editor?’ setting.

Configure plugin editor settings

Next, switch to the ‘Code Editor’ tab from the top of the page.

From here, you can choose a theme for the code editor from the dropdown menu. This will display the code in your theme and plugins in different backgrounds and font colors.

Once you are done, don’t forget to click the ‘Save Changes’ button to store your settings.

Choose a code editor theme

Editing Your Theme Files Using the Theme Editor

Now, you need to visit the Theme Editor » Theme Code Editor page from the WordPress admin dashboard.

Once you are there, you need to select the theme that you want to edit from the dropdown menu in the right corner of the screen. Next, you must choose the theme file where you want to add code from the sidebar on the right.

After that, you can easily add, remove, or edit code to your theme files from the theme editor on your screen.

Choose theme to edit

Once you are done, don’t forget to click the ‘Update File’ button to store your settings.

You can also download the file you just edited by clicking on the ‘Download File’ button. If you want to download the whole theme instead, then you can click the ‘Download Theme’ button.

Save theme files

Editing Your Plugins Using the Plugin Editor

If you want to add code to your plugin files instead, then you need to visit the Theme Editor » Plugin Code Editor page from the WordPress admin sidebar.

Once you are there, choose a plugin to edit from the dropdown menu in the right corner of the screen.

After that, you can select a plugin file to edit from the sidebar on the right and then edit it using the plugin code editor.

Edit plugin files

Once you are satisfied with your changes, just click the ‘Update File’ button to store your settings.

You can even download the file you just edited by clicking the ‘Download File’ button.

If you want to download the plugin with all the changes that you have made, then you can click the ‘Download Plugin’ button instead.

Download plugin files

Configuring Access Control With the Theme Editor Plugin

The Theme Editor plugin even lets you control access to your theme and plugin editors in WordPress. However, this feature is only available in the pro version of the plugin.

This way, only users who you approve will be able to edit the themes and plugins on your website.

By using access control, you make your website more secure by allowing only trustworthy users to make changes to your files, reducing the risk of malware.

First, you need to visit the Theme Editor » Access Control page from the WordPress dashboard.

Control the access to theme and plugin editor

From here, you just need to check the options in the columns that you want the WordPress user roles to have access to.

For example, if you want the editor to have the ability to update theme files, then you need to check that box in the ‘Editor’ row.

Once you are done, simply click the ‘Save Changes’ button to store your settings.

Creating a Child Theme With the Theme Editor

If you want to create a child theme to customize your WordPress themes, then you can visit the Theme Editor » Child Theme page from the WordPress admin sidebar.

Once you are there, you will first need to choose a parent theme from the dropdown menu in the middle and then click the ‘Analyze’ button.

Choose a parent theme

Once that’s done, you must provide a name for your new theme directory and select where to save your child theme stylesheet.

After that, you can even provide a name, description, author, and version for the child theme that you are creating.

Once you are done, just click the ‘Create New Child Theme’ button.

Configure child theme settings

Now that you have created a child theme, you can edit the selector, web fonts, CSS, child style, and theme files from the menu bar at the top of the page.

The changes that you make will automatically be saved in your child theme.

Child theme created

Bonus: Use WPCode to Add Custom Code to Your Website

Adding code to your website using plugins or theme file editors is always a bit risky because the smallest error can break your WordPress website and make it inaccessible.

That is why we recommend using the free WPCode plugin instead to add custom code to your website. It is the best WordPress code snippets plugin on the market.

First, you need to install and activate the WPCode plugin. For detailed instructions, you can see our tutorial on how to install a WordPress plugin.

Upon activation, you need to head over to the Code Snippets » + Add Snippet page from the WordPress admin sidebar.

From here, you can use the WPCode snippet library to add pre-made code snippets to your WordPress site.

However, if you want to add custom code, then you can also do that by clicking the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

Add new snippet

This will open the ‘Create Custom Snippet’ page, where you can start by adding a title for your code snippet.

After that, you need to select a code type from the dropdown menu in the right corner of the screen. For example, if you want to add PHP code, then you just need to select the ‘PHP Snippet’ option.

Next, simply add your custom code into the ‘Code Preview’ box.

PHP Snippet as code type

Once you have done that, scroll down to the ‘Insertion’ section and choose the ‘Auto Insert’ mode.

Your custom code will be automatically executed on your site upon activation.

Choose an insertion method

Finally, scroll back to the top and toggle the ‘Inactive’ switch to ‘Active’.

After that, click the ‘Save Snippet’ button to save and execute the custom code on your website.

Save code snippet

For more details, you can see our guide on how to add custom code in WordPress.

We hope this article helped you learn how to easily replace the default theme and plugin editor in WordPress. You may also want to see our beginner’s guide on how to safely update WordPress and our expert picks for the must-have WordPress plugins to grow your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Replace Default Theme and Plugin Editor in WordPress first appeared on WPBeginner.

How to Remove Parent Slug From Child Page URL in WordPress

Wp Plugins

Are you wondering how to remove the parent page slug from a child page URL in WordPress?

By default, WordPress adds the parent page’s slug as a prefix to child page URLs, and this is good for SEO. However, some people may not want the parent page slug in the URL.

In this article, we will show you how to remove the parent page slug from a child page URL in WordPress.

How to Remove Parent Slug From Child Page URL in WordPress

What Is a Parent Page Slug in WordPress?

Your WordPress website comes with two main content types called posts and pages.

Pages are hierarchical, which means they can have child pages. These child pages are dependent on their parent pages and typically cover subtopics related to the parent.

For example, you might have a ‘Products’ parent page with ‘Pricing’, ‘Support’, and ‘Features’ child pages.

By default, the URL of a child page in WordPress will have its parent page’s slug in the URL. Here’s an example:

http://example.com/parent-page/child-page/

Using URLs like this is the best way to organize content within a hierarchical page structure on your website. These URLs are considered best practice for WordPress SEO and will make sense to your users when they read them.

It’s usually not a good idea to remove the parent page slug. It can potentially break the URL, and some experts believe it is less SEO-friendly. Sometimes, it may even cause conflicts with the WordPress permalink structure.

In our experience, if you don’t want a parent page slug in your child page URL, then the best approach is to not create a child page at all. Instead, you can simply create a normal page and use a navigation menu to show that other pages belong under that page.

Adding Child Items to a Menu

However, we understand that some users may still want to use child pages and not include the parent page slug within the URL.

That being said, let’s take a look at how to easily remove the parent page slug from a child page URL in WordPress.

Removing Parent Page Slug From Child Page URL in WordPress

The first thing you need to do is install and activate the Custom Permalinks plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to edit the child page that you want to change. Under the content area, you will see a ‘Custom Permalinks’ field where you can change the child page URL.

Change child page URL

The permalink field will show your page’s current default URL. You just need to click it and enter the custom URL you want to use for your child page.

In our example, the hollywood-boulevarde page is a child page oflocations, so the default permalink is locations/hollywood-boulevarde.

We deleted the locations parent slug from the URL, as you can see in the screenshot below.

Custom page URL

Don’t forget to click the ‘Update’ button to save your page and store your URL changes.

After saving your changes, the plugin will automatically redirect the old permalink to the new address. This means your visitors will not see a 404 error if they click a link or bookmark to the page’s old address.

When you view the child page, you will now notice that its URL does not contain the parent slug.

Our Best Guides on Pages and Child Pages

Now that you know how to customize a child page’s URL in WordPress, you may want to learn more about how to use pages and child pages in WordPress:

We hope this article helped you learn how to remove the parent page slug from a child page URL in WordPress. You may also want to see our guide on how to create a custom page in WordPress or our expert picks for the best drag and drop page builder plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Remove Parent Slug From Child Page URL in WordPress first appeared on WPBeginner.

What Is Google Knowledge Panel + How to Claim It With WordPress

Featured Imgs 11

Are you wondering how to claim a Google knowledge panel?

When you are looking at a search engine results page (SERP), Google often displays informational panels about people, organizations, and products with the most important facts in one convenient place. This is known as a Google knowledge panel.

In this article, we will show you what a Google knowledge panel is and how to claim it for your business with WordPress.

What Is Google Knowledge Panel + How to Claim It With WordPress

What Is Google Knowledge Panel?

Sometimes, when you are searching for information on Google, you will see a panel containing relevant information on the right side of the screen. This is called a Google knowledge panel.

It is designed to quickly summarize information about a topic to help users understand more about what they are searching for.

These panels are created on the fly using information from Google Knowledge Graph. This is a giant collection of information that Google scrapes from the web, similar to an encyclopedia.

Knowledge panels about organizations show the company’s name and logo and a quick summary of the company taken from Wikipedia.

Example of an Organization Google Knowledge Panel

You can also find a link to the company’s website, contact details, some historical and financial information, and a list of their popular products.

Knowledge panels about people are similar. They have a link to the person’s website, a quick biographical summary, as well as a list of important facts.

Example of a Person Google Knowledge Panel

If a knowledge graph hasn’t been claimed yet, then you will see a ‘Claim this knowledge panel’ button at the bottom. We will show you how to claim your knowledge panel later in this article.

If Google Knowledge Graph contains a lot of information about a person, then there may be an additional knowledge panel at the top of the page.

Example of a Person Google Knowledge Panel

There are also knowledge panels for products. These can’t be claimed by one organization because they feature a variety of online stores that are selling the product.

They show an overall rating for the product, buttons to pop up Details, Reviews, and Stores, and a shopping section that offers a price range and links to different stores.

Example of a Product Google Knowledge Panel

Google knowledge panels are helpful to the user because they provide relevant information that is presented in an easy-to-use way. They are also useful for website owners.

How Do Google Knowledge Panels Help Website Owners?

Google knowledge panels are very visible in the search results and can display a lot of useful information about your business. They make it much more likely that users will click on a link and visit your website. This is great for your website’s SEO.

Like Google answer boxes and featured snippets, knowledge panels make your website stand out on search engine results pages (SERPs) and are likely to be the first thing users look at.

You can claim your business’s knowledge panel to verify that it belongs to you. This gives you some benefits, such as being able to choose a featured image and suggest edits to Google.

If you have an online store, then it’s also worth trying to be featured in product knowledge panels. This allows users to compare your prices and click on a link to your store.

Google knowledge panels are also great for brand visibility. Since these panels contain a business’s logo and other branding elements, they can introduce your brand to more people.

With that said, let’s take a look at how to claim a Google knowledge panel with WordPress.

How to Claim a Person or Organization Knowledge Panel

Google allows you to claim a knowledge panel about a person or organization. However, you can’t claim a product knowledge panel.

To be featured in a product knowledge panel, you will need to add your products to Google Knowledge Graph using product schema, which we will show you how to do in the next section.

For now, let’s take a look at how to claim a person or organization knowledge panel.

Claiming a Person or Organization Knowledge Panel

First, you need to sign in to a Google account to claim your knowledge panel. You should use the account you use for your business needs, such as your Google Business account or business email address.

Now, you can search for your business name (or your own name) and look for the knowledge panel on the right. Make sure that the panel isn’t about a different business or person with a similar name.

Click the 'Claim This Knowledge Panel' Button

You should notice a button near the bottom of the panel that says, ‘Claim this knowledge panel’. Go ahead and click the button now.

Note: If you don’t see a knowledge panel for your business, then it may not have made it to Google Knowledge Graph yet. You should see the next section on how to add your website content to Google Knowledge Graph.

You will be taken to a page that describes how you can enhance your presence on Google. You need to click the ‘Get Verified’ button to verify that you are the owner of the business.

Click the 'Get Verified' Button

This will take you to the ‘Get verified on Google’ form. You will be asked to confirm the name of the business or person you are trying to claim.

After that, you will be asked a series of questions that demonstrate you have the right to claim the knowledge panel for that business or person.

The 'Get Verified on Google' Page

Google may ask you to upload a photo of yourself holding a valid ID. It may also ask you to provide screenshots of your online profiles, such as LinkedIn, Facebook, Twitter, and YouTube.

Once you have finished, you will need to check the box next to the agreement at the bottom of the page and then click the ‘Submit’ button.

Click the 'Submit' Button

On the final page, you will be thanked for the submission and told that Google will get back to you soon. You can expect to receive a confirmation email in several hours or the next day.

Suggesting Edits to a Person or Organization Knowledge Panel

Once you have claimed your Google knowledge panel, you can choose a featured image and hide personal information that you don’t want to be displayed, such as your date of birth or marital status.

You can’t change the content of the knowledge panel, but you can suggest edits.

Simply make sure you are logged into the Google account that claimed the knowledge panel, and then you can click the ‘Suggest edits’ link at the top or bottom of the panel.

However, before you suggest an edit, remember that Google found the information somewhere else on the web. It’s much better to find the source of the information and ask that source to change it. If you are unsuccessful, then you can suggest an edit to your knowledge panel.

How to Add Your Website Content to Google Knowledge Graph

The information contained in knowledge panels is automatically created using information from Google Knowledge Graph. While you can’t pick what content is displayed, you can make sure that Google can find and understand information from your WordPress website.

The best way to do that is to use schema markup to structure your website. This is a special type of HTML code that gives search engines more information about your website and its pages.

You can easily add schema to your site and individual pages using All in One SEO (AIOSEO), which is the best WordPress SEO plugin on the market. It automatically adds schema support to your site and offers many ways to optimize your content for higher search engine rankings.

Note: For this tutorial, we will use the free version of AIOSEO since it lets us add schema markup. However, there is also AIOSEO Pro that offers many extra features to help your website rank higher.

You can learn how to install and configure the plugin in our complete guide on how to install and set up All in One SEO for WordPress.

Adding Knowledge Graph Schema to Your Website

You need to go to the All in One SEO » Search Appearance page and scroll down to the ‘Knowledge Graph’ section. This is where you can let search engines know some basic information about yourself or your business.

First, you need to add the name of your website. This can simply be the name of your business or something more specific, such as ‘My Awesome Business Blog’. Optionally, you can type an alternate name for your website, like an acronym.

AIOSEO's Knowlege Graph Settings

In the next section, you need to click on the button to choose whether the website is for a person or organization. This will determine the type of knowledge graph your website information will be displayed in.

Next, you can type your organization name and phone number. You can also select the phone number’s team or department from a dropdown menu.

AIOSEO's Knowlege Graph Settings

Finally, you can add the logo you would like displayed on the knowledge panel. Make sure the image is no larger than 112 x 112 pixels in size.

There is also a button you can click to add local SEO settings. For more details, see the local business SEO setup section of our guide on how to set up All in One SEO.

AIOSEO's Knowlege Graph Settings

Once you have finished, make sure you click the ‘Save Changes’ button at the bottom of the screen to store your settings.

Adding Product Schema to Your Online Store

You can’t claim your products to make them appear in product knowledge panels. Instead, you need to add the right schema markup so that Google can consider your online store when displaying places to purchase different products.

Luckily, All in One SEO supports Merchant Listing schema markup, which will give Google the information it needs to include you.

When you edit any product in WooCommerce, you will notice that All in One SEO has automatically added a new ‘AIOSEO Settings’ area below the product editor.

AIOSEO product settings

You can use this section to customize the way your product title and description will appear on search results pages. You can see a preview next to ‘Snippet Preview’.

Now you should switch to the ‘Schema’ tab, and you will notice that AIOSEO has already added Product schema for you.

Product schema

You can add more information about your product by clicking the ‘Edit Schema’ pencil icon.

If you like, you can autogenerate fields based on the product data from WooCommerce. Now, you should fill in as much information as possible for each product, including the brand, material, identifiers, and more.

Edit product schema in All in One SEO

This product information will be added to Google Knowledge Graph so that Google has the option of adding it to product knowledge panels.

For detailed instructions, you can see the optimizing WooCommerce SEO section of our guide on how to set up All in One SEO.

Adding an About Page in WordPress

Google may also look at your About page when displaying information about your business in a Google knowledge panel.

You will want to make sure your website has an About page and add it to your navigation menu.

The page can let users know about the purpose, mission, and values of your business, and it’s also a good place to introduce your team.

About WPBeginner Page

You can learn more in our guide on important pages that every WordPress blog should have.

Bonus Tips for Getting Your Business Information Into Google Knowledge Graph

Of course, your website is only one source of information about your business that Google can use in its knowledge panels.

Here are a few more ways you can get the word out about your business and increase the chances of that information being added to Google Knowledge Graph.

Optimizing Your Social Media Presence

Google scrapes social media platforms for information it can use in knowledge panels.

That means it is essential to set up social media profiles for your business on major platforms like Facebook, Twitter, Instagram, Pinterest, and more. You might also consider adding your business to Wikidata.org.

After creating your social profiles, you need to navigate to All in One SEO » Social Networks. Here, you can paste the URLs to the profiles that you created.

AIOSEO's Social Profile Settings

This will let search engines know about the social profiles that are associated with your website, and they may be included in your Google knowledge panel.

For step-by-step directions, you can see the section on setting up social media optimization in our social media cheat sheet for WordPress.

Become Featured on Wikipedia and Wikidata

Google also scrapes authoritative websites like Wikipedia to use the information in knowledge panels. That makes being featured on Wikipedia very valuable.

Wikipedia’s rules prevent you from creating a Wikipedia entry about yourself or your business. That is to make sure that all entries are unbiased.

However, you can add your business information to Wikidata.org. Google Knowledge Graph draws information from this source, and it is also a source of useful information commonly used by Wikipedia authors.

Make sure you link to any third-party sources that can verify the information you add. This adds credibility to the facts you claim about your business.

Get Your Business Featured on Other People’s Websites

You might also be able to place information about your business on other websites. One of the best ways to do that is to look for blogs that accept guest posts.

Writing guest posts on other people’s websites can help you get valuable backlinks to your website, boosting your SEO. It can also give you the opportunity to talk about the history of your business or the products and services you offer.

You can also use websites like Help a Reporter Out (HARO). This is a website where reporters ask for information on a topic, and they may choose to publish your answer along with a link to your website.

You could also interview other people in your industry and post them on your website. Those people may then link to the interview on your site. Other ideas include being a guest on a podcast, writing an expert roundup that covers your industry, and speaking at events.

FAQs About Google Knowledge Panels

Here are some of the questions our readers ask us most often about Google knowledge panels.

What is a knowledge panel in Google?

A Google knowledge panel is a useful summary of information displayed on the right side of a Google search results page. This panel may be about a person, organization, product, or location.

The information is automatically pulled from Google Knowledge Graph. People and organizations can claim their knowledge panels.

How do I get a Google knowledge panel?

A Google knowledge panel is displayed automatically when someone searches for your business, as long as the Google Knowledge Graph contains information about your business.

If a knowledge panel isn’t displayed after searching for your business, then the best thing to do is add schema markup to your site to make it easier for Google to understand.

If a Google knowledge panel is displayed about yourself or your business, then you can follow our tutorial to claim it.

What does claiming a Google knowledge panel do?

There are a few benefits to claiming your Google knowledge panel. It will show Google that the business is yours, allow you to choose a featured image, and allow you to suggest changes to the content.

How much does a Google knowledge panel cost?

Google knowledge panels don’t cost anything. Google creates them automatically when it knows something about your business. Even claiming your Google knowledge panel is free.

Can I create my own Google knowledge panel?

No, Google knowledge panels are generated automatically, and you cannot make your own. However, the knowledge panels contain information found on the internet.

That means you can influence the contents of your knowledge panel by adding useful information to your website using schema markup and by claiming your knowledge panel and suggesting edits.

You can also influence its content by adding information about your business to social media platforms and third-party websites.

Why don’t I have a Google Knowledge panel?

If a knowledge panel isn’t displayed when performing a Google search on your business, then most likely, there isn’t enough information about your business in the Google Knowledge Graph.

You can help Google learn about your business by using schema markup on your website, being active on social media, and getting your business featured on other people’s websites.

We hope this tutorial helped you learn how to claim your Google knowledge panel with WordPress. You may also want to see our guide on how to track website visitors or our expert picks for the best social media plugins for WordPress to grow your audience.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post What Is Google Knowledge Panel + How to Claim It With WordPress first appeared on WPBeginner.

How to Customize and Style Your WordPress Forms (2 Easy Methods)

Category Image 091

Are you wondering how to style your WordPress forms?

You can customize your forms to match your WordPress website’s design. This can create a more visually appealing and professional look for your site and improve the user experience.

In this article, we will show you how to easily customize and style WordPress forms, step by step.

Customize and style your WordPress forms

Why Customize and Style Your WordPress Forms?

When you add a form to your WordPress website using a plugin, you will notice that its layout is usually simple and plain-looking.

For example, if you add a registration form to your website using a user-registration form plugin, then you will see that its layout is a bit boring. This can fail to capture your visitor’s attention and even discourage them from filling out the form.

Registration form preview

By customizing your forms, you can match them to your WordPress theme and your branding to make them more attractive.

This can lead to more conversions because styled WordPress forms are easier to navigate and can encourage more users to fill them in.

Styled form preview

Styled forms can also increase your brand awareness among users. For instance, you can use your website logo and signature company colors to make your form more memorable and effective.

Having said that, let’s see how to easily customize and style your WordPress forms, step by step. We will cover 2 methods in this post, and you can use the quick links below to jump to the one you want to use:

Method 1: How to Customize and Style WordPress Forms With WPForms (Code Free Method)

You can easily customize and style your WordPress forms using WPForms. It is the best WordPress contact form plugin on the market, used by over 6 million websites.

WPForms comes with a drag-and-drop builder that makes it super easy to create any kind of form you want. Plus, it even has built-in customization options for your form that don’t require any coding.

First, you need to install and activate the WPForms plugin. For detailed instructions, you may want to see our step-by-step guide on how to install a WordPress plugin.

Note: WPForms also has a free version that you can use for this tutorial. However, we will be using the premium plugin because it has more settings and options.

Upon activation, you need to visit the WPForms » Settings page from the WordPress admin sidebar to enter your license key.

You can find this information in your account on the WPForms website.

Entering the WPForms license key

Once you’ve done that, head over to the WPForms » Add New screen from the WordPress dashboard.

This will take you to the ‘Select a Template’ page, where you can start by typing a name for your form. After that, you can pick any form template that you want and click the ‘Use Template’ button under it.

For the sake of this tutorial, we will be creating and adding a simple contact form to our website.

Choose the contact form template

This will launch the template in the WPForms form builder, where you will see a form preview on the right and form fields in the left column.

From here, you can drag and drop any form field of your choice to the form according to your liking.

For detailed instructions, see our tutorial on how to create a contact form in WordPress.

Save your form

Once you are done customizing your form, simply click the ‘Save’ button at the top to exit the form builder.

After that, you need to visit the WPForms » Settings page from the WordPress dashboard and check the ‘Use Modern Markup’ option. If you fail to check this box, then the WPForms customization settings won’t be available in the block editor.

Don’t forget to click the ‘Save Changes’ button to store your settings.

Enable modern markup in WPForms

Next, open the page or post where you want to add the form that you just created.

From here, you need to click the add block ‘+’ button in the top left corner of the screen to open the block menu and add the WPForms block.

Once you have added the block, simply select the form that you want to add to your site from the dropdown menu within the block itself.

Add the WPForms block

Now that you’ve added the form, it’s time to customize it and style it.

To do this, you must open the block panel on the right side of the screen and scroll down to the ‘Field Styles’ section.

From here, you can select a size for your form fields from the dropdown menu and even set a border radius for them.

Change form field size and radius

Next, you can change the background, text, and border color of the form fields by using the color picker tool.

Here, you can use your brand’s signature colors or other colors that are used on the rest of your WordPress blog to create a visually appealing form.

Change field color

Once you’ve done that, scroll down to the ‘Label Styles’ section, where you can select the font size of the labels from the dropdown menu.

After that, you can also change the font color of the labels, sub-labels, and error messages that will be displayed in your form.

Configure label style

To customize the button in your form, you need to scroll down to the ‘Button Styles’ section and choose its size from the dropdown menu.

You can also set a border radius and change the background and text color of the form button.

Configure button style

Once you’ve finished customizing the form, simply click the ‘Update’ or ‘Publish’ button at the top to store your settings.

Now, you can visit your site to view the styled WordPress form in action.

Form customization preview

Method 2: How to Style WordPress Forms With CSS (Advanced Customization)

If you don’t want to use the customization options offered by WPForms or you want to apply different customizations with CSS, then you can also use a custom CSS snippet.

To do this, first, you will have to create a form using WPForms, which is the #1 form builder on the market.

It is a drag-and-drop builder that comes with many templates that you can use to create contact forms, file upload forms, registration forms, RSVP forms, and much more.

For detailed instructions, you can see our tutorial on how to create a contact form in WordPress or see method 1.

Once you have created a form, it’s time to customize it using WPCode, which is the best WordPress code snippets plugin on the market.

WPCode WordPress code snippets plugin

It is the easiest and safest way to add CSS code for styling your WordPress form.

First, you will need to install and activate the WPCode plugin. For detailed instructions, you may want to see our beginner’s guide on how to install a WordPress plugin.

Note: WPCode has a free version. However, you will need the premium plan of the plugin to unlock the ‘CSS Snippet’ option.

Upon activation, visit the Code Snippets » + Add Snippet page from the WordPress dashboard.

Once you are there, just click the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

Add new snippet

This will take you to the ‘Create Custom Snippet’ page, where you can start by typing a name for your code snippet.

After that, select the ‘CSS Snippet’ option from the dropdown menu in the right corner of the screen.

Choose CSS snippet option from the dropdown menu

Next, copy and paste the following code into the ‘Code Preview’ box:

#wpforms-0000 .wpforms-form {
    background-color: #ADD8E6 !important;
	font-family: 'Arial', sans-serif !important;
    padding: 20px 15px !important;
    border: 3px solid #666 !important;
    border-radius: 20px !important;
}

Once you’ve done that, you will have to replace the default shortcode at the top with the shortcode of the form that you want to customize.

To do this, visit the WPForms » All Forms page from the WordPress dashboard and copy the WPForms ID number of the form that you want to style.

copy the form ID number

After that, paste the ID number of the form next to the wpforms- line in the code. Now, all the code will be executed in this specific form only.

Next, you can easily change the hex code for the background color, add a font family of your choice, and configure the padding and border radiuses of the form by changing the code snippet.

Add form ID number in the code snippet

Once you have done that, scroll down to the ‘Insertion’ section and select the ‘Auto Insert’ mode.

The code will automatically be executed on your site upon activation.

Choose an insertion method

Finally, scroll back to the top of the page and toggle the switch to ‘Active’.

After that, click the ‘Save Snippet’ button to store your settings

Save form styling snippet

Now, the WordPress form will automatically be customized according to the CSS snippet, and you can go view it.

However, if you haven’t added the form to your website yet, then just open a page or post in the block editor.

Once you are there, click the ‘+’ button in the top left corner to open the block menu and add the WPForms block.

Add the WPForms block

After that, select the form that you styled using the CSS snippet from the dropdown menu in the block itself.

Finally, click the ‘Update’ or ‘Publish’ button to store your settings.

Now, you can visit your WordPress site to see the customized form in action.

Form CSS styling preview

Bonus: How to Create Custom Website Pages

Styling WordPress forms is just one way to make your site more attractive and visually interesting. You can also design your own fully customized website pages using SeedProd.

It is the best WordPress page builder plugin on the market that allows you to create attractive pages without using any code.

SeedProd comes with a drag-and-drop builder, pre-made templates and site kits, easy customization options, color palettes, and advanced page blocks. Plus, you can easily embed your WPForms forms within the SeedProd editor.

Adding a contact form to your maintenance page

You can even use SeedProd to create a viral waitlist page, a sales page, a maintenance page, a coming soon page, and so much more.

For more details, you can see our tutorial on how to create a landing page in WordPress.

We hope this article helped you learn how to customize and style your WordPress forms. You may also want to see our tutorial on how to add a coupon code field to WordPress forms and our comparison of WPForms vs. Gravity Forms vs. Formidable Forms.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Customize and Style Your WordPress Forms (2 Easy Methods) first appeared on WPBeginner.

How To Add Link To a Custom WordPress Footer

Featured Imgs 13
Customizing your WordPress website is a great way to make it unique. One easy way to do this is by adding links to the footer of your theme’s template. This not only allows you to include links to any website you want, but it can also boost your search engine rankings if you link to […]

How To Schedule Backup Of Your WordPress Blog

Fotolia Subscription Monthly 4685447 Xl Stock
The Ultimate Guide to Backing up Your WordPress Blog Establishing a reliable backup strategy is one of the most crucial steps to protect your WordPress blog. Whether you opt for automated backups or prefer to handle them manually, regularly backing up your WordPress blog is a must-do. A Backup Strategy You Can Rely On One […]

Padding vs Margin – What’s the Difference in WordPress?

Category Image 091

Do you want to know the difference between padding and margin in WordPress?

In WordPress, padding is the space between the content and the border within a block, while margin is the space between two separate blocks.

In this article, we will show you the difference between padding and margin and how to use them in WordPress.

Difference between padding and margin in WordPress

What Is Padding in WordPress?

The padding feature on your WordPress website is used to create space inside a block.

For example, you can add space inside a Text block to make its layout more visually appealing and prevent text from appearing too close to the borders of the block.

Padding preview

You can also use padding to control how the content flows on your WordPress blog. For instance, if you add padding to the top and bottom of a Text block, you can make it easier for visitors to read the content.

What Is Margin in WordPress?

Margin is the space around the border of a WordPress block and its surrounding elements.

This can help you add space between two different blocks, creating a more spacious and clean layout for your site.

Margin preview

For example, you can add margins to the top and bottom of a Text block so that it remains visible even when the screen is resized.

Plus, you can also use margins to add space between Image and Text blocks to make your website visually appealing and more accessible for users.

What Is the Difference Between Padding and Margin in WordPress?

Here is a quick list of the differences between padding and margin in WordPress:

PaddingMargin
Padding means adding space between the content and the border of the block.The margin feature adds space outside the border of the block.
Using padding does not affect the other blocks on your website.Using a margin affects other blocks on your website.
Padding can create a buffer around a block.Margins can create space between two different blocks.

How to Use Padding in WordPress

By default, the WordPress full site editor (FSE) comes with the padding feature.

However, keep in mind that if you are not using a block-based theme, then you won’t be able to add padding to your WordPress site unless you use custom CSS.

First, you need to visit the Appearance » Editor page from the WordPress admin sidebar to launch the full site editor.

Once you are there, just choose the page template where you want to add padding to your blocks from the ‘Templates’ sidebar on the left. This sidebar will display all the templates for different pages on your website.

Choose the page where you want to add padding from the left column

After you have done that, the template that you chose will open up on the screen.

From here, click the ‘Edit’ button to start customizing your page template in the full site editor.

Click the Edit icon for full site editor

Next, choose the block where you want to add padding. Remember this means that you will be creating space between the content and the border of the block.

This will open the block’s settings in the block panel on the right side of the screen.

From here, you need to scroll down to the ‘Dimensions’ section and click on the three-dotted menu. This will open a prompt where you must select the ‘Padding’ option.

Choose the padding option from the Dimensions section

Next, simply use the slider to add padding to your block.

Keep in mind that this feature will add padding to all the sides of the block.

Padding in full site editor

However, if you only want to add padding to the top or bottom of the block, then you can also do that by clicking the ‘Unlink Sides’ icon next to the ‘Padding’ option.

Then, you can use different sliders to add padding to the right, left, bottom, or top of the block.

Padding for different corners

Once you are done, just click the ‘Save’ button to store your settings.

How to Use Margin in WordPress

Just like padding, the margin feature comes built-in in the WordPress full site editor. However, this feature won’t be available if you are not using a block theme.

First, head over to the Appearance » Editor page from the WordPress dashboard.

Once you are there, choose the page template where you want to add margins from the column on the left.

Choose page for margin from the left column

This will open the page template that you chose on the screen.

From here, just select the ‘Edit’ button to start customizing your template in the full site editor.

Click the Edit icon for full site editor

Next, choose the block that you want to edit and scroll down to the ‘Dimensions’ section in the block panel on the right.

From here, simply use the sliders to set different margins for the top, bottom, left, and right corners of the block. Using this feature will create space around the block that you chose.

Add margin in the full site editor

However, if you want to use a single slider to add equal margins around the block, then click the ‘Link Sides’ icon next to the ‘Margin’ option.

The block panel will now display a single ‘Margin Mixed’ slider on the screen that you can use to create equal margins around the block.

Use margin slider

Once you are done, don’t forget to click the ‘Save’ button at the top to store your settings.

More Tips for Full Site Editing in WordPress

Other than adding padding and margins to your blocks, you can also use the full site editor to customize your entire WordPress theme.

For example, you can design all your page templates, add your own custom logo, choose brand colors, change the layout, adjust the font size, add background images, and more.

You can also add patterns and different blocks to your website to further customize it. For details, you may want to see our beginner’s guide on how to customize your WordPress theme.

Add patterns to your layouts

You can also use the FSE to add a header, navigation menu, or custom CSS to your website.

Additionally, you can also use Global Styles to ensure consistency across your site. For more detailed instructions, you may want to see our guide on how to customize colors on your WordPress website.

Choose a background color from the Color Picker

However, if you don’t like using the full site editor and would prefer more control over your website’s appearance, then you can use SeedProd to build pages and even your entire theme.

It is the best landing page builder on the market that comes with a drag-and-drop builder that makes it super easy to create an amazing theme for your website.

For more details, you can see our tutorial on how to easily create a custom WordPress theme.

Edit theme template

We hope this article helped you learn the difference between padding and margin in WordPress. You may also be interested in our beginner’s guide on how to change block height and width in WordPress and our top picks for the best Gutenberg blocks plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Padding vs Margin – What’s the Difference in WordPress? first appeared on WPBeginner.

Comparing Free WordPress.com vs. Self-Hosted WordPress.org

Category Image 091
Choosing between a free WordPress blog and a self-hosted WordPress blog ultimately depends on your goals and needs as an Internet marketer. While the free version may be easier to set up and manage, it lacks the flexibility and control that a self-hosted blog offers. Comparison: Free Vs. Self-Hosting WordPress Blog When it comes to […]

How to Select and Use Nested Blocks in WordPress

Typography Definitions Cover

Do you want to learn how to select and use nested blocks in WordPress?

The WordPress Gutenberg nested blocks feature allows you to add multiple blocks within a parent block. Then, you can customize different block elements at the same time, organize post content efficiently, and access more design flexibility.

In this article, we will show you how to easily select and use WordPress nested blocks.

Select and use nested blocks in WordPress

What Are WordPress Nested Blocks?

The WordPress Gutenberg nested block feature allows you to insert (or ‘nest’) one or more blocks within another block.

Nested blocks help you create more complex layouts on your WordPress website by adding multiple blocks inside each other. This allows for more flexibility when designing and formatting content for pages and posts.

For instance, you can nest multiple Image blocks within a Group block to display a set of photos from a particular event or a series of artworks created using a particular technique.

Preview of WordPress nested blocks

Moreover, the nested block feature allows you to edit individual blocks separately. This means that you can customize each block according to your needs without affecting the other blocks. In turn, this results in better content organization, makes your content more attractive, and streamlines your content creation process.

That being said, let’s see how you can easily select and use WordPress Gutenberg nested blocks.

How to Use WordPress Nested Blocks

You can easily nest multiple blocks together using the Group or Columns block in the Gutenberg block editor.

First, you need to open up an existing or new post in the block editor from the WordPress admin sidebar.

From here, simply click on the ‘+’ button in the top left corner of the screen and find the ‘Group’ block. Upon clicking it and adding it to the page, you will need to select a layout for the blocks that you will nest together.

For this tutorial, we will be selecting the ‘Group’ layout.

Select Group block from the block menu

Next, simply click on the ‘+’ button on the screen to start adding content within the parent block.

For the sake of this tutorial, we will be adding an Image block.

Add an image block within the Group block

Upon adding the Image block, just click the ‘Group’ button in the block toolbar at the top to select the parent block.

Next, you need to click the ‘+’ button to open up the block menu, from where you can choose other blocks to add.

Open the block menu to add another block within the Group block

How to Configure WordPress Nested Block Settings

Once you have nested multiple blocks, you can configure their individual settings by clicking on each block. This will open up the block settings in the right column on the screen.

From here, you can adjust the background color, text color, and size of the individual blocks without affecting the other blocks that are nested within it.

Configure the individual block settings

To configure the settings of all the nested blocks together, you will have to click the ‘Group’ button in the block toolbar at the top. This will open up the parent block settings in the right column.

You can now configure the justification, orientation, background color, text color, and typography of all the nested blocks.

Keep in mind that these settings will affect all the blocks nested within the parent block.

Configure the settings of the Group block

You can also convert an existing individual block into nested blocks by clicking the ‘Options’ button in the top toolbar of any block.

This will open up a menu prompt, where you need to select the ‘Create Reusable block’ option.

Choose the Create Reusable Block option

Once you have done that, a new reusable block will be created where you can add multiple blocks.

After you are done, don’t forget to click the ‘Publish’ or ‘Update’ button to save your changes.

Create nested blocks

In our example, we have nested a Title, Image, and Paragraph block within a Group block. This is how the nested blocks looked on our demo website.

Preview of WordPress nested blocks

Bonus: Use the Wayfinder Plugin to Easily Select Nested Blocks

Sometimes, it can be difficult to select an individual block and configure it when there are multiple blocks nested together.

Luckily, the Wayfinder plugin makes it super easy to select nested blocks from a parent block and even tells you the type and class of the blocks.

First, you will need to install and activate the Wayfinder plugin. For more instructions, you may want to see our guide on how to install a WordPress plugin.

Upon activation, head over to the Settings » Wayfinder page from the WordPress admin sidebar.

Once you are there, all the settings will already be activated. You simply need to uncheck the box next to the settings that you don’t want to use.

For example, if you want Wayfinder to display block types for all the blocks in the editor, then keep the box checked next to the ‘Display block type’ option.

Configure the Wayfinder plugin settings

However, if you don’t want the plugin to display block classes, simply uncheck the box next to that option.

After configuring the settings, don’t forget to click the ‘Save Changes’ button.

Next, you need to open up an existing or new post from the WordPress admin sidebar.

Once you are there, hovering your mouse over any block will show an outline with its name. You will also be able to see the outline and name of any nested blocks within the parent block.

GIF for the Wayfinder plugin

This will help you identify all the different blocks that are nested within a Group or Columns block.

From here, you can easily select an individual block from the parent block to configure its settings.

Use Wayfinder plugin to easily select a block

You can also select all the nested blocks at the same time by simply clicking on the ‘Columns’ or ‘Group’ heading. This will open up the parent block settings in the right column.

Once you have configured the block settings, simply click the ‘Update’ or ‘Publish’ button to save your changes.

Click the Group block outline to open its settings

We hope this article helped you learn how to select and use WordPress nested blocks. You may also want to see our tutorial on how to change block height and width in WordPress and our top picks for the must-have WordPress plugins to help grow your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Select and Use Nested Blocks in WordPress first appeared on WPBeginner.

How to Use Shortcodes in your WordPress Sidebar Widgets

Category Image 052

Do you want to learn how to use shortcodes in your WordPress sidebar widgets?

You can add shortcodes to any page or post using the Shortcode block. However, if you want to use the same code across your entire site then it may be easier to add it to a sidebar widget instead.

In this article, we will show you how to use shortcodes in the WordPress sidebar.

How to use shortcodes in your WordPress sidebar widgets

Why Use Shortcodes in Your WordPress Sidebar Widgets?

Shortcodes allow you to add advanced content and features to your website, including contact forms, tables, random quotes, and much more. WordPress comes with several built-in shortcodes but some plugins also add their own shortcodes.

You can add shortcodes to any page or post using the WordPress editor and built-in Shortcode block. However, if you want to use shortcode across your entire site then it often makes sense to add it to the sidebar.

For example, you can display Instagram photos in the WordPress sidebar using a shortcode provided by Smash Balloon Instagram Feed.

An example of a social media sidebar widget

This content will then appear across your entire WordPress website, so you don’t need to add it each page and post manually. This can save you a ton of time and effort, and helps to keep your site’s design consistent.

With that in mind, let’s look at a few different ways to add and use shortcodes in the WordPress sidebar widgets. Simply use the quick links below to jump straight to the method you want to use.

Method 1: Using the WordPress Shortcode Widget (Easy)

Most free and paid WordPress themes come with widget-ready sidebars. With that in mind, you can often simply add a Shortcode widget to your website’s sidebar.

First, go to Appearance » Widgets in your dashboard. Here, you’ll see all the different areas where you can add widgets in WordPress, including the sidebar.

Adding a shortcode widget to a WordPress sidebar

Simply click on the ‘+’ button and start typing in ‘Shortcode.’

When the right block shows up, drag it onto the WordPress sidebar.

How to add a shortcode to the WordPress sidebar

You can now add your shortcode to the block.

When you’ve finished, don’t forget to click on ‘Update’ to make the changes live.

Publishing a shortcode block in WordPress

You can now visit your WordPress blog or website to see the shortcode in action.

Method 2. Using the Full Site Editor (Works With Block-Enabled WordPress Themes)

If you’re using a block theme then you can add shortcode to the sidebar using the full-site editor. In your WordPress dashboard, go to Themes » Editor.

Opening the WordPress full-site editor (FSE)

This opens the full-site editor, with one of your theme’s templates already selected.

If you want to add shortcode to a different template, then click on the arrow in the toolbar and select ‘Browse all templates.’

Choosing a block-based FSE template

You’ll now see all the different templates that make up your theme.

Simply find the template where you want to add the shortcode, and give it a click.

A block-based WordPress theme

After that, click on the ‘+’ button and start typing in ‘Shortcode.’

When the right widget shows up, simply drag it onto the theme’s sidebar.

Adding a WordPress block to the sidebar

You can now add your shortcode to the widget. When you’re happy with your changes, click on ‘Save’ to make the shortcode live.

Method 3: Using the Custom HTML Widget (More Customizable)

Sometimes you may want to show other content along with the shortcode. For example, RafflePress can add a contest or giveaway to your sidebar using a shortcode. To draw even more attention to the contest, you may want to show a heading above the competition.

An example of a giveaway created using RafflePress

Instead of creating separate Shortcode and Heading blocks, you can simply add the shortcode and text to a Custom HTML block. This helps you arrange the different content in a nice layout. You can also style the block using HTML, so you can control exactly how it looks in the sidebar.

The Custom HTML block doesn’t support shortcodes by default, but you can easily change this by adding custom code to WordPress. After adding this code, you can use shortcodes in any Custom HTML block across your entire WordPress website.

Often, you’ll find guides with instructions to add custom code to your site’s functions.php file. However, this isn’t recommended as any mistakes in the code can cause common WordPress errors, or even break your site completely.

That’s where WPCode comes in.

This free plugin makes it easy to add custom CSS, PHP, HTML, and more to WordPress, without putting your site at risk. Even better, it comes with a library of ready-made snippets including code that allows you to use shortcodes in text widgets.

To start, you’ll need to install and activate WPCode. For more information, you can see our step-by-step guide on how to install a WordPress plugin.

After that, go to Code Snippets » Add Snippet in the WordPress dashboard. You can now start typing in ‘shortcode.’

Adding a code snippet to your WordPress website

When it appears, hover your mouse over the following snippet: ‘Enable Shortcode Execution in Text Widgets.’

You can then go ahead and click on ‘Use snippet.’

Adding shortcode to a custom HTML block using code

This will open the snippet in the WPCode editor. WPCode configures the snippet settings for you, so you can simply click on the ‘Inactive’ switch so that it turns blue.

With that done, click on ‘Update’ to make the snippet live.

Adding shortcode to a sidebar widget using code

Now, you can add a shortcode to any text widget.

Simply go to Appearance » Widgets and type ‘Custom HTML’ into the search bar.

Adding a Custom HTML widget to a WordPress sidebar

When the right block appears, drag it onto your website’s sidebar.

With that done, you can add your HTML and shortcode to the block.

Adding a custom HTML widget to a WordPress website

When you’re happy with how the widget is set up, click on ‘Update.’

Now if you visit your website, you’ll see the shortcode and custom HTML live.

FAQ: Using Shortcodes in WordPress Sidebar Widgets

No matter what theme you’re using, you should be able to add shortcodes to the sidebar using one of the methods above. However, if you need extra help then here are some of the most frequently asked questions about adding shortcodes to the sidebar.

How Do I Change Where the Sidebar Widget Appears?

The sidebar’s location is controlled by your WordPress theme. If you’re not happy with the sidebar’s position then you may be able to change it using the theme settings.

Many of the best WordPress themes let you choose between different layouts. Often, this includes showing the sidebar on different sides of the screen.

To see whether your theme has different sidebar layouts, go to Appearance » Customize in the WordPress dashboard. Here, look for any settings labeled Sidebar or similar.

Changing your theme's sidebar settings

Simply click on this option and look for any settings that allow you to change where the sidebar appears on your site.

For example, the following image shows the sidebar settings in the Astra WordPress Theme.

The Astra sidebar settings

After making your changes, click on the ‘Publish’ button to make the new sidebar layout live.

If you can’t change the sidebar’s location using the built-in settings, then another option is to create a WordPress child theme.

How Do I Add a Sidebar to My WordPress Theme?

If your theme doesn’t have a sidebar then you could create a child theme and then add a sidebar using code.

If you’re not comfortable writing code, then you can also create a custom WordPress theme using a plugin such as SeedProd. You can use this popular page builder plugin to design your own theme and sidebar using a simple drag-and-drop editor.

For step-by-step instructions, please see our guide on how to create a custom WordPress theme without any code.

How Do I Use a Different Shortcode on Each Post or Page?

Sometimes you may want to use different shortcodes on some of your posts and pages.  For example, you might want to show the most popular posts on your archive page and display ads on your homepage.

To learn more, please see our guide on how to display different sidebars for each post and page in WordPress.

We hope this article helped you learn how to easily add shortcodes to your WordPress sidebar widgets. You may also want to see our guide on how to create a landing page with WordPress or our expert pick of the best social media plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Use Shortcodes in your WordPress Sidebar Widgets first appeared on WPBeginner.

How to Fix WordPress Redirecting to Old Domain After Migration

Featured Imgs 11

Do you want to fix the issue of redirecting to an old domain?

When you migrate a WordPress website to a new domain, there is a possibility that users will be redirected back to the old domain.

In this article, we will show you how to fix WordPress redirecting to an old domain after migration.

How to fix WordPress redirecting to old domain after migration

What Causes Redirection to Old Domain After Migration Issue?

When you’re moving your WordPress website to a new domain, it is important to set up redirection. This way, users automatically land on the new location, and you get to keep your keyword rankings and traffic.

However, redirection to a new domain may not work properly, and your visitors would be redirected back to the old domain.

One of the main causes for this issue is that your site URL and home URL values are different in the WordPress database tables. You need to make sure that both these values lead to your new domain.

Besides that, DNS issues can also cause users to redirect to the old domain after migration. If the DNS server is not responding or DNS records haven’t been updated, then your visitors won’t be able to view your new website URL.

That said, let’s see how you can fix WordPress redirecting to the old domain after migration. We will cover different methods, so you can click the links below to jump ahead to your preferred section.

Method 1: Update the Site Address in WordPress Settings

The easiest way to fix this issue is by ensuring that the WordPress address and site address is the same in your WordPress settings.

If your Site Address (URL) still shows the old domain, then users will be redirected to the previous URL after migration.

To fix this, simply head to Settings » General from your WordPress admin panel. After that, enter your new domain under the ‘Site Address (URL)’ field.

Site address URL

Once you’re done, simply save your changes and visit the new domain to see if the problem is resolved.

If, however, the URL fields are greyed out and won’t let you type a new address, continue reading and use one of the other methods to redirect your domain.

Method 2: Changing Site URL in WordPress Database

Another method of fixing the redirecting to the old domain issue is by updating the site URL in the WordPress database tables.

You can easily access the database using the cPanel provided by the WordPress hosting service. For this tutorial, we will be using Bluehost as an example, but the process is similar for other hosting companies like Hostinger, SiteGround, etc.

First, you’ll need to log in to the hosting service control panel. After that, simply click on the ‘Advanced’ tab from the menu on your left.

Bluehost's PhpMyAdmin tool

Next, you can scroll down to the Databases section and click the ‘phpMyAdmin’ option.

You will need to wait for a few seconds until phpMyAdmin opens.

Once it opens, you will need to go to the wp_options table from the navigational panel on your left.

Do note that each hosting service has a different naming convention for database tables. However, the one you’re looking for will always end in ‘_options.”

For example, in this tutorial, we will click the ‘staging_45f_options’ table in Bluehost’s phpMyAdmin.

Open the options table

Next, you will need to edit the ‘siteurl’ and ‘home’ options.

First, go ahead and click the ‘Edit’ button for ‘siteurl’ option.

Enter siteurl

After that, you will need to enter the new domain name in the option_value field. Once that’s done, simply click the ‘Go’ button.

Now, you can return to the main wp_options page and edit the ‘home’ option.

Enter the home field value

Next, you will need to enter the new domain in the option_value field.

After entering the value, click the ‘Go’ button.

Method 3: Flush DNS Cache on Your PC

If you’re still unable to resolve the issue of the old domain redirecting after migration, then you should check the DNS settings.

At times, it can take up to 12 to 48 hours for the change of domain name to take effect. As a result, internet providers that don’t have updated DNS records will redirect users to the old domain.

You simply flush the DNS cache so that it gets the latest information and the new website URL. This also helps resolve the DNS server not responding issue.

For more details, please see our guide on how to clear your DNS cache on Mac, Windows, and Google Chrome.

Pro Tip: Use SEO Plugin to Perform Full Site Redirect

When you manually perform redirection to a new domain, then there is always a chance of errors. As a result, users would still be redirected to the old domain.

An easier way of setting up redirection is by using an WordPress SEO plugin like All in One SEO (AIOSEO). It offers a powerful redirection manager that you can use to redirect your entire site to a new domain without any issues.

Full site redirect in All in One SEO

This tool was built by our team, and it is what we use when we’re migrating websites to a new domain or merging two sites into one. You can learn more by following our step by step guide on how to properly do a full site redirect in WordPress.

We hope that this article helped you learn how to fix WordPress redirecting to an old domain after migration. You may also want to see our guide on the most common WordPress errors and how to fix them and our expert picks for the must-have WordPress plugins for business sites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix WordPress Redirecting to Old Domain After Migration first appeared on WPBeginner.

How to Change Block Height and Width in WordPress

Category Image 091

Do you want to change block height and width in WordPress?

By default, WordPress makes it easy to create beautiful content layouts for your posts and pages using blocks. However, sometimes you may want to resize blocks to make them look better.

In this article, we will show you how to easily change block height and width in WordPress.

How to change block height and width in WordPress

Why Change Block Height and Width in WordPress?

The block editor enables you to add content to your WordPress website using different blocks, including headings, paragraphs, images, videos, audio, and more.

However, sometimes you may want to change the width or height of a specific block to improve its appearance or the layout of the overall content.

Adjusting block sizes can also ensure that your content is responsive and displays properly on all devices, including phones, tablets, and laptops.

For example, you may have uploaded an image in the content editor, but it is too large and makes the page look unappealing.

Preview of an image

Or, you might want to change the size of the heading block to align it better with the content.

By adjusting the width and height of the blocks, you can make your posts and pages look more aesthetically pleasing.

That being said, let’s see how you can easily change block height and width in WordPress.

Method 1: Change the Block Height and Width Using Block Settings

For this method, we will show you how to change a block’s height and width using the default settings offered by WordPress.

Currently, WordPress does not offer the same resizing options for all of the blocks. However, the block editor provides many ways to resize the height and width of different blocks.

Let’s start with the Image block in WordPress.

First, you can change the alignment of the Image block by clicking on the ‘Align’ button in the toolbar above the block.

Here, choosing the ‘Wide Width’ option will make the block the same width as the container.

Or, the ‘Full Width’ alignment option will make the block the entire width of the page.

Use alignment settings to resize an image

You can also resize a block by going to the ‘Block Settings’ panel on the right and scrolling down to the ‘Settings’ section. From here, you can resize a block from the ‘Image Size’ dropdown menu.

You can also adjust the block’s width and height by typing the preferred pixel size into the ‘Width’ and ‘Height’ boxes in the ‘Image dimensions’ section.

Below that, you can also adjust the block’s size by percentage.

Resize an image using block panel settings

Another way to resize an Image block is by clicking on the image itself to bring up a blue border with circular anchors.

Then, simply drag these anchors to change the height and width of the image block.

Resize Image block using anchors

Once you are done, click on the ‘Update’ or ‘Publish’ button to store your settings.

Method 2: Change the Block Height and Width Using the Columns Block

If the block you want to resize does not come with alignment buttons or resize settings, then this method is for you.

For this method, we will place our block inside the Columns block. It acts as a container where you can add blocks in each column. Then, you can resize those blocks by adjusting the height and width of the columns.

First, you will need to click on the ‘Add Block’ (+) button in the top left corner of the screen.

From here, simply locate and add the Columns block to the content editor. Then, you will be asked to choose a variation.

Choose the column block

After that, the column layout will be displayed on the screen, and you can now add the block you want by clicking on the ‘Add Block (+)’ button inside a column.

Once the block has been added, you can resize it by using the ‘Column settings’ located in the right panel.

Add Block using column

Once you are done, simply click the ‘Publish’ button to store your changes.

This is how the content looked on our demo website after resizing and aligning two paragraph blocks inside a two-column block.

Column block preview

Method 3: Change the Block Height and Width Using the Group Block

You can also adjust the width and height of blocks using the Group block. It allows you to group different blocks and style them together.

First, you will need to click on the ‘Add Block’ (+) button at the top. Next, you must locate and add the Group block to the content editor.

Once you do that, the Group block will display three different layout options that you can choose from. For this tutorial, we will use the ‘Group’ layout.

Choose the Group block and select a layout

After that, the ‘Add Block’ button will be displayed on the screen. You can now add any block you want.

In this tutorial, we will be adding and resizing a Heading block, a Paragraph block, and an Image block.

Add a heading block to the Group block

To add multiple blocks to the Group, you must click on the ‘Select Group’ button from the block toolbar.

Once the Group is selected, simply click on the ‘Add Block’ button (+) at the bottom.

Add multiple blocks in Group

Clicking on the ‘Select Group’ button also opens up the block settings in the right column. From here, you can easily adjust the layout, justification, and orientation of all the blocks.

Changing the layout will also change the different block sizes. You can configure these settings until you are happy with the result.

Configure the block settings of the Group block

Once you are done, click on the ‘Update’ or ‘Publish’ button to store your settings.

This is how the Group block looked on our demo website.

Group block preview

Method 4: Change the Block Height Using the Cover Block

This resizing method is for you if you want to use the Cover block. It enables you to display text and other content on top of an image or video.

First, you will need to click on the ‘Add Block’ (+) button at the top and find the Cover block.

Once you have done that, you will be asked to choose a color or upload an image from the WordPress media library. This image or color will be used as the background for the Cover block.

Add the Cover block

Next, simply drag and drop any block you want into the Cover block.

After that, you need to click on the Cover block to open up its block settings in the right column.

From here, scroll down to the ‘Dimensions’ panel, where you can adjust the height of the Cover block using pixels.

Change the Cover block height

Finally, don’t forget to click on the ‘Save Changes’ button to store your settings.

For more detailed instructions on how to use the Cover block, you may want to see our beginner’s guide on Cover Image vs. Featured Image in the WordPress block editor.

Bonus: Create Beautiful Pages Using Advanced Blocks in SeedProd

You can easily create beautiful and aesthetically-pleasing pages using the SeedProd plugin.

It is the best WordPress page builder on the market that allows you to create landing pages using blocks. These blocks are also super easy to customize and resize according to your needs.

First, you will need to install and activate the SeedProd plugin. For more details, you can read our guide on how to install a WordPress plugin.

Note: SeedProd also offers a free version, but we will be using the premium version for this tutorial.

Upon activation, you must go to the SeedProd » Settings page from your WordPress dashboard and enter the license key in the ‘License Key’ box.

You can find the license key on your account page on the SeedProd website.

Paste license key in the field

Next, you need to visit the SeedProd » Landing Pages screen from the admin sidebar to start creating a landing page.

From here, just click on the ‘Add New Landing Page’ button.

Click the Add New Landing Page button

You will now be taken to the ‘Choose a New Page Template’ page. SeedProd offers many pre-made templates that you can pick from.

After you have selected a template, you will be asked to provide a name and URL for your landing page.

Upon adding these details, simply click on the ‘Save and Start Editing the Page’ button to continue.

Enter your page details

This will launch SeedProd’s drag-and-drop page builder, where you can now start editing your page.

For more detailed instructions, please see our guide on how to create a landing page with WordPress.

For this tutorial, we will be adding and resizing an Image block and a Button block.

First, you will need to drag the Image block from the block panel on the left and drop it anywhere you like on the page.

Choose the image block in the SeedProd

Next, simply click on the Image block to open its block settings in the left column. From here, you can upload an image from your media library.

Next, you can change the block’s height and width using pixels or percentages.

Change the block size in SeedProd

You can also adjust the image size and position by switching to the ‘Advanced’ tab at the top of the settings panel.

Then, just click on the Spacing panel to expand its settings.

Visit the Spacing panel by switching to the Advanced tab

Here, simply add values to adjust the block’s margin and padding according to your needs.

You can adjust the margin and padding for the top, bottom, left, and right areas of the block.

Ajust the margin and padding of the block

With Seedprod, you can also add a Spacer block between two different blocks to put some space between them.

First, you will need to locate and add the ‘Spacer’ block from the left column. Then, click on it to open its settings.

Add the Spacer block

Now, you can control the height of the spacer using the ‘Height’ slider.

The spacer block can help you create a clutter-free website.

Use the height slider to adjust Spacer block

You can also change the width and height of other blocks in the same way, including the Video, Heading, and Button blocks.

Simply find the Button block in the left column and drag it onto your page.

Add the Button block to the website

Next, you will need to click on the Button to open up its block settings.

From here, switch to the ‘Advanced’ tab from the top. You can change the height of the block by dragging the ‘Vertical Padding’ slider.

Changing height of the button block

To change the width, drag the ‘Horizontal Padding’ slider in the left column.

Once you are done, don’t forget to click on the ‘Save’ button.

Change width of the button block

We hope this article helped you learn how to change block width and height in WordPress. You may also want to see our article on how to add and align images in the WordPress block editor and our top picks for the must-have WordPress plugins to grow your site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Change Block Height and Width in WordPress first appeared on WPBeginner.

How to Customize the Background Color of WordPress Block Editor

Category Image 091

Do you want to change the background color of the WordPress block editor for admins?

Sometimes when working on a custom client project, you may want to change the Gutenberg editor background color in WordPress to match their brand colors.

In this article, we’ll show you how to easily customize the background color of the WordPress block editor for admin area.

Changing the background color of WordPress block editor

Note: This guide covers changing the editor color in WordPress admin. If you’re looking to change the background color in WordPress front-end, then please see our tutorial on how to change background color in WordPress.

Why Change the Background Color of the Block Editor in WordPress?

You may want to change the background color of the WordPress block editor for a number of reasons.

For instance, most modern WordPress themes use the same background color for the block editor as the live website including Astra, OceanWP, GeneratePress, and more.

However, if your WordPress theme doesn’t use the same colors, then the appearance of your post inside the editor will look quite different from what your users will see on the live website.

Another reason for changing the background color could be personal preference.

For instance, by default, the block editor uses a plain white background. Some users may find it a bit stressful to look at the white screen for long hours. Eye strain can be a real issue for many people, and the default white background is not easy on the eyes.

Default block editor

That being said, let’s see how you can easily change the WordPress editor background color.

How to Change the WordPress Editor Background Color

You can easily change the WordPress editor background color by adding custom code to your theme’s functions.php file.

However, keep in mind that even the smallest error in the code can break your website and make it inaccessible. That’s why we recommend using the WPCode plugin. It’s the best WordPress code snippets plugin on the market and is the easiest and safest way to add custom code to your WordPress website.

First, you need to install and activate the free WPCode plugin. For more instructions, please see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you need to visit the Code Snippets » + Add Snippets page from the admin sidebar.

From here, you have to click on the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

Add new snippet

This will take you to the ‘Create Custom Snippet’ page where you can start by typing a name for your code snippet. This is just for you and can be anything that will help you identify the code.

Next, you need to choose ‘PHP Snippet’ as the ‘Code Type’ from the dropdown menu on the right.

Choose PHP Snippet option as the code type for changing editor background color

After that, you need to copy and paste the following code into the ‘Code Preview’ box.

add_action( 'admin_footer', function() {
	?>
	<style>
		.editor-styles-wrapper {
			background-color: #bee0ec;
		}
	</style>
	<?php
});

Next, you need to look for the following code in the PHP snippet you just pasted.

background-color: #bee0ec;

Then, you have to add the hex code of your preferred color next to the background color option. If you don’t want to use a hex code, you can use some basic color names such as ‘white’ or ‘blue’ instead.

Paste the code snippet for changing the editor background color

After that, you need to scroll down to the ‘Insertion’ section and choose the ‘Auto Insert’ option.

Next, you need to select the ‘Location’ of the code snippet as ‘Admin Only’ from the dropdown menu.

Choose the insertion method and location of the code snippet

After that, you need to scroll back to the top of the page and toggle the ‘Inactive’ switch to ‘Active.’

Finally, don’t forget to click on the ‘Save Snippet’ button to save your changes.

Save the code snippet for changing the background color

Now, go visit the block editor from the admin sidebar.

This is how the block editor looked on our site after adding the CSS code snippet.

Editor color preview

We hope this article helped you learn how to easily change the WordPress editor background color. You may also want to see our ultimate guide on 85+ time saving WordPress shortcuts, or take a look at our top picks for the best WordPress page builder plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Customize the Background Color of WordPress Block Editor first appeared on WPBeginner.

How to Use Icon Fonts in WordPress Post Editor (No Code)

Category Image 091

Do you want to use icon fonts in the WordPress post editor?

Icon fonts allow you to easily use images and symbols in text. They are lightweight and won’t slow down your site, and they can be easily scaled to any size and styled like any other text font.

In this article, we’ll show you how to easily use icon fonts in the WordPress post editor without writing any HTML code.

Using icon fonts in the WordPress editor

We’ll show you multiple methods, each one using a slightly different approach than the other. You can choose one that works best for you.

Method 1. Adding Icon Fonts in WordPress Post Editor using JVM Rich Text Icons

This method is recommended to use on any kind of WordPress website. It is easy to use and works seamlessly with the block editor.

First, you need to install and activate the JVM Rich Text Icons plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you can simply edit a WordPress post or page or create a new one. Inside the post editor, add a new paragraph block, and you’ll see a new Flag icon in the block toolbar.

Icon font button in the block toolbar

Clicking on it will show a popup of icons to choose from. It uses the popular Font Awesome icon fonts by default.

You can use the search to look for an icon or simply scroll down to find the icon you want, and then click to add it.

Choose icons to insert

One advantage of using icon fonts is that you can use CSS to style them.

However, since you are already using the block editor, you can simply use the built-in color tools to style the icons.

Style icon fonts using block editor tools

The plugin allows you to use icon fonts in most text blocks such as Paragraph, List, Button, Columns, Cover, and more.

Here is an example of using icon fonts and block options to style three columns.

Icon fonts in columns

Another useful example of using icon fonts is with buttons.

This time we are using inline icon fonts alongside some text for the two buttons.

Using icon fonts in buttons and lists

Feel free to use the block editor tools like text alignment, colors, spacing, and more to get the most out of the icon fonts.

Method 2. Add Icon Fonts in WordPress Post Editor with Font Awesome

This method requires you to add shortcodes in the post editor to display icon fonts. You can use this method if you don’t need to regularly use icon fonts in your WordPress posts and pages.

First, you need to install and activate the Font Awesome plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you can edit a post or page in WordPress and use the following shortcode to add a font icon.

[icon name="home"]
Adding icon fonts using shortcode

The name parameter here is the name of the font used by Font Awesome. You can find the entire list on the Font Awesome cheatsheet page.

Once added, you can preview your post or page to see how the icon will look on the live site since it will not display as an icon in the block editor.

This is how it looked on our test site.

Font icon preview

You can use the shortcode inside a paragraph and inline with other text. You can also add it on its own using the ‘Shortcode’ block.

However, using the ‘Shortcode’ block will not give you the styling options you’ll get with other text blocks.

You can also add the shortcode inside columns to create a features row.

Shortcode in columns

It would be a bit trickier as you will not be able to see the actual images, and the column heights will keep changing within the editor.

Here is how it looked on our test website. The columns are the same height, even though they are not in the editor.

Icon fonts preview using Font Awesome

You’ll probably have to preview your work in a new browser tab many times to see how it will look to users.

Method 3. Using Icon Fonts with WordPress Page Builders

This method is great if you are creating a landing page or designing your website using a WordPress page builder like SeedProd.

SeedProd is the best WordPress page builder on the market. It allows you to easily create beautiful landing pages or design your complete website.

SeedProd WordPress Website Builder

First, you need to install and activate the SeedProd plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, you’ll be asked to enter your plugin license key. You can find this information under your account on the SeedProd website.

SeedProd license key

After entering your license key and clicking ‘Verify Key,’ you can start working on your landing page.

Simply go to the SeedProd » Landing Pages page and click on the ‘Add New Landing Page’ button.

Add new landing page

After that, you will be asked to choose a template for your landing page.

SeedProd comes with a bunch of beautiful designs that you can use as a starting point, or you can start with a blank template and design the whole thing yourself.

Choose landing page template

For this tutorial, we will be using a pre-designed template. Simply click on a template to select it and continue.

Next, you will be asked to provide a title for your landing page and choose a URL.

Provide page title and URL

After entering them, click on the ‘Save and Start Editing the Page’ button to continue.

SeedProd will now launch the page builder interface. It is a drag-and-drop design tool where you can simply point and click on any item to edit it.

SeedProd page builder interface

You can also drag and drop blocks from the left column to add new elements to your design.

For the sake of this tutorial, we are going to add the Icon block.

Add icon block

After you add the block, you can simply click to edit its properties.

The left column will change to show the options for the Icon block. You can click into the ‘Icon’ section to the left and choose a different icon image or change the color and style.

Icon block settings

Another way to use icons in SeedProd is by adding the ‘Icon Box’ block.

The difference between this and the ‘Icon’ block we used previously is that ‘Icon Box’ allows you to add text along with your chosen icon.

This is one of the most common ways to use icons when displaying product features, services, and other items.

Icon box block

You can place your icon box inside columns, choose colors, and adjust the icon size to your liking.

Additionally, you can also format the accompanying text using SeedProd’s formatting toolbar.

Icon box inside columns

Once you are finished editing your page, don’t forget to click on the ‘Save’ button at the top right corner of the screen.

If you’re ready, you can click ‘Publish’ for the page to go live, or you can click on ‘Preview’ to make sure it looks like you want it to.

Save and publish your landing page

You can also click on ‘Save as Template’ so you can reuse this design with SeedProd on other parts of your website.

Here is how the icon fonts looked on our test website.

Icon fonts preview

We hope this article helped you learn how to use icon fonts in WordPress post editor without writing HTML code. You may also want to see our WordPress performance guide to optimize your website speed or the best landing page plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Use Icon Fonts in WordPress Post Editor (No Code) first appeared on WPBeginner.

How to Password Protect Your WordPress Admin (wp-admin) Directory

Category Image 032

Do you want to learn how to password-protect your WordPress admin directory?

Adding another layer of password protection to your WordPress admin directory can be a great way to improve your WordPress security.

In this article, you’ll learn how you can password-protect your wp-admin directory easily.

How to Password Protect Your WordPress Admin (wp-admin) Directory

Why Password Protect Your WordPress Admin Directory?

By password-protecting your WordPress admin directory, you improve the security of the most important entry point to your WordPress website.

Your WordPress admin dashboard is the central hub of your site. It’s where you’ll publish posts and pages, customize your theme, install WordPress plugins, and more.

Often, when hackers try to get into your website, they’ll do it through the wp-admin screen. You can help to protect your website against potential attacks by using a secure password and limiting login attempts.

To be even more secure, you can also password-protect the wp-admin directory. Then when someone attempts to access your admin area, they’ll need to enter a username and password before they ever make it to the WordPress login screen.

With that said, let’s take a look at how you can password-protect your WordPress admin directory step by step.

The first method is recommended for most users, and you can use the quick links below to jump straight to the method you want to use.

Method 1: Password-Protect wp-admin Using Directory Privacy (Recommended)

The easiest way to password-protect your WordPress admin directory is by using your WordPress hosting provider’s Directory Privacy app.

First, you need to log in to your hosting account dashboard and click on the ‘Directory Privacy’ option in the Files section of your website’s advanced settings.

Click Directory Privacy

Note: Most web hosts using cPanel, like Bluehost, will have similar steps. However, your dashboard might be slightly different from our screenshots depending on your hosting provider.

This brings you to a screen that lists all of the different directories on your server. You need to find the folder that contains your website files.

For most website owners, this can be found by clicking on the ‘public_html’ folder.

Click public_html

This brings up all of the website files you’ve installed on your server.

Next, you’ll need to click on the folder with your website’s domain name.

Click domain name folder

In that folder, you’ll see a ‘wp-admin’ folder.

Instead of clicking the folder name, you’ll need to click the ‘Edit’ button next to that folder.

Click edit wp-admin folder

This brings you to a screen where you can turn on password protection.

Simply check the box that says ‘Password protect this directory’. If you like, you can also give your directory a name like ‘Admin Area’ to help you remember.

Check password protect directory box

Once you’ve done that, you’ll need to click the ‘Save’ button.

This will take you to a page where the confirmation message will appear.

Confirmation message click back button

Now you’ll need to click the ‘Go Back’ button and you’ll be taken to a screen where you can create a user that will be able to access this directory.

You will be asked to enter a username and password, and then confirm the password. Make sure to note your username and password in a safe place, such as a password manager app.

Create a User

Make sure you click the ‘Save’ button when you’ve done that.

Now, when someone tries to access your wp-admin directory, they will be prompted to enter the username and password you created above.

Password protect WordPress admin example

Method 2: Password-Protect wp-admin Using Code

You can also password-protect your WordPress admin directory manually. To do this you’ll need to create two files called .htpasswd and .htaccess.

Note: Adding any code to your website can be dangerous. Even a small mistake can cause major errors on your site. We only recommend this method for advanced users.

Creating the .htaccess File

First, open up your preferred text editor and name the new file .htaccess.

After that, you need to copy the following code snippet and add it to the file.

AuthName "Admins Only"
AuthUserFile /home/user/public_html/example.com/wp-admin/.htpasswd
AuthGroupFile /dev/null
AuthType basic
require user yourusername

Make sure you change the ‘AuthUserFile’ path to the location where you’ll upload the .htpasswd file and change ‘yourusername’ to the username you want to use to log in.

Don’t forget to save the file when you’re finished.

Creating the .htpasswd File

Once you’ve done that, you need to create a .htpasswd file.

To do this, open up a text editor and create a file called .htpasswd. This file will list your username along with your password in an encrypted format.

The easiest way to generate the encrypted password is with a htpasswd generator.

Simply enter your username and password, select the encryption format, and click the ‘Create .htpasswd file’ button.

Create htpasswd file

The htpasswd generator will display a line of text that you need to paste into your .htpasswd file. Make sure you save the file once you’ve done that.

Uploading .htaccess and .htpasswd to the wp-admin Directory

The last step is to upload both of the files you created to your website’s wp-admin folder.

You will need to connect to your WordPress hosting account using an FTP client or the online file manager tool provided by your hosting provider. For more details, see our beginner’s guide on how to use FTP to upload files to WordPress.

For this tutorial, we’ll use FileZilla because it’s free and works on both Mac and Windows.

Once you have connected to your website, you will see the files on your computer in the left window, and the files on your website in the right. On the left, you need to navigate to the location where you saved the .htaccess and .htpasswd files.

Then on the right, you need to go to the wp-admin directory for the website you wish to protect. Most users will need to double-click the ‘public_html’ folder, then the folder with their domain name, then the ‘wp-admin’ folder.

Now you can select the two files on the left and click ‘Upload’ from the right-click menu or simply drag the files onto the left window.

Uploading the Files to Your Website's wp-admin Directory

Now your ‘wp-admin’ directory will be password protected.

Troubleshooting wp-admin Password Protection

Depending on how your server and website are set up, there’s a chance you might run into errors. These errors can be fixed by carefully adding code to your .htaccess file.

Note: This is the .htaccess file located in your main website folder, not the one you uploaded to the ‘wp-admin’ folder. If you’re having trouble finding it, then see our guide on why you can’t find .htaccess and how to locate it.

Fixing the Ajax Not Working Error

One of the most common errors is that Ajax functionality may stop working on the front end of your site. If you have WordPress plugins that require Ajax, such as live Ajax search or Ajax contact forms, then you will notice that these plugins won’t work anymore.

To fix this, simply add the following code to the .htaccess file that’s located in your ‘wp-admin’ folder.

<Files admin-ajax.php>
    Order allow,deny
    Allow from all
    Satisfy any 
</Files>

Fixing the 404 Error and Too Many Redirects Error

Two other errors you might run into are the 404 error and the too many redirects error.

The simplest way to fix them is to open up your main .htaccess file located in your website directory and add the following line of code before the WordPress rules.

ErrorDocument 401 default

We hope this article helped you learn how to password-protect your WordPress admin (wp-admin) directory. You may also want to see our expert picks of the best email marketing services for small businesses and our guide on how to get a free email domain.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Password Protect Your WordPress Admin (wp-admin) Directory first appeared on WPBeginner.