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.

How to Download Your Entire WordPress Media Library (3 Ways)

Wp Plugins

Do you want to download all the images and media files from your WordPress website?

By downloading your media library, you can easily store a backup of your media files on your computer or, if you have created another WordPress site, then you can also transfer these images from one site to another.

In this article, we’ll show you how to easily download your entire WordPress media library, step by step.

How to download your entire WordPress media library

Why Would You Want to Download the Media Library?

The WordPress media library stores all the media files that you have uploaded to your site. If you want to create a backup of these media files, then you can easily do that by downloading a copy of the media library and storing it on your computer.

You can always use a fully automated WordPress backup solution to back up your entire WordPress site (including plugins, themes, posts, and the media library).

However, most backup plugins do not offer an easy way to just download and upload your media library.

You could also use your WordPress hosting account file manager or FTP to download the media library, but these methods are a bit complicated and confusing for beginners.

With that being said, we’ll show you some easy ways to easily download your entire media library in WordPress.

Method 1. Download Media Library Using The Export Media Library Plugin

For this method, we’ll be using a plugin to download the media files.

First, you need to install and activate the Export Media Library plugin. For more details, see our guide on how to install a WordPress plugin.

Upon activation, go to the Media » Export page from your admin area.

Once you’re on the ‘Export Media Library’ page, simply choose the ‘Single folder with all files’ option from the dropdown menu beside the ‘Folder Structure’ option.

Download the media library using the Export Media Library plugin

Now all your media will be downloaded into one folder. They will be downloaded as the original file types, such as JPG, PNG, or SVG.

If you want your media to be placed into separate folders based on the time of upload, then choose the ‘Nested Folder’ option from the dropdown menu.

After that, simply click the ‘Download Zip’ button, and your entire media library will be downloaded into a zip file on your computer.

Method 2. Download the Entire WordPress Backup Including Media Files

If you want to create a backup for your entire WordPress website including the media library, then this method is for you.

We’ll be using the Duplicator plugin which is the best WordPress backup plugin on the market and enables you to create a complete backup of your WordPress website.

First, you’ll need to install and activate the Duplicator plugin. For more details, see our guide on how to install a WordPress plugin.

Upon activation, you need to visit the Duplicator » Packages page from the admin sidebar and click on the ‘Create New’ button.

Create a new backup by clicking the Create New button

Next, you need to choose a name for your WordPress backup.

It can be anything that will help you identify the backup once it’s downloaded on your computer.

After that, click on the ‘Next’ button to continue.

Choose a backup name

In the next step, your website will be scanned for potential errors.

Once the scan is complete, simply click on the ‘build’ button to create your package.

Note: If an error is highlighted by Duplicator during the scan, you would need to solve that error before rescanning and building your package.

Scan complete

Once the package is built, you need to click on the ‘Download Both Files’ button.

Now, your installer and archive files will be downloaded simultaneously.

Click the Download both files button

Your WordPress website backup including media files will now be downloaded and stored on your computer.

If you want to restore a WordPress backup, you may also want to see our guide on how to restore WordPress from a backup.

Method 3. Download Media Library Using WordPress Settings

In this method, we’ll show you how to download your entire media library from your WordPress backend and import it to another WordPress website.

Note: This method allows you to download the media library without using any plugins. However, we do not recommend this method because it exports your media as an XML file.

This method can come in handy if you want to import your WordPress media library to one of your other websites.

For that, head over to the Tools » Export page from the WordPress admin dashboard.

Now that you’re on the ‘Export’ page, simply check the box beside the ‘Media’ option.

If you don’t want to download your entire library, then you can also select a date range for a specific time frame. With this feature, only the images uploaded during your chosen time frame will be downloaded.

Finally, click on the ‘Download Export File’ button.

Choose media on the export page

Now, your WordPress media library will be saved on your computer as an XML file.

Next, you need to install and activate the WordPress Importer plugin. For more instructions, please see our guide on how to install a WordPress plugin.

This plugin will allow you to import your XML file to another WordPress website.

First, you need to visit the Tools » Import page from the admin sidebar.

Then you can simply click on the ‘Run Importer’ link below the ‘WordPress’ option.

Click on the run importer link

This will take you to the ‘Import WordPress’ page where you need to click on the ‘Choose File’ button.

Now, you can upload your media library XML file from the computer.

Import media

Once you’re done, don’t forget to click on the ‘Upload file and import’ button to upload the media library.

We hope this article helped you download your WordPress media library. You may also want to see our tutorial on how to speed up your WordPress website, and our comparison of the best Instagram 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 Download Your Entire WordPress Media Library (3 Ways) first appeared on WPBeginner.

How to Add an SEO Editor Role in WordPress

Wp Plugins

Do you want to add an SEO Editor role in WordPress?

If you have hired an SEO specialist to work on your website, then adding them as an SEO editor is the safest way to give them access to your WordPress website.

In this article, we’ll show you how to easily add an SEO editor role in WordPress.

How to Add an SEO Editor role in WordPress

Why Add an SEO Editor Role in WordPress?

WordPress comes with a user role management system that defines what a user can and cannot do on your website. You can assign different user roles to your team members depending on their job descriptions.

By adding an SEO Editor / Manager role to your WordPress website, you will be providing secure access to the SEO features and tools to some specific members of your team.

An SEO Editor role has access to the SEO settings for all your posts and pages. This allows them to optimize posts for SEO and work on search rankings.

An SEO Manager tends to have access to sitewide SEO settings including sitemaps, redirects, local SEO, and more.

By default, WordPress doesn’t offer either the SEO Editor or SEO manager user roles.

However, you can easily add these roles by using the All in One SEO for WordPress. It is the best WordPress SEO plugin on the market and allows you to easily optimize your WordPress website like a pro.

It also comes with powerful access control features which enable you to safely give your SEO team limited access to your website.

That being said, let’s take a look at how to easily add an SEO editor or manager user role in WordPress.

How to Add SEO Editor / Manager User Roles in WordPress

First, you need to install and activate the All in One SEO for WordPress plugin. For more instructions, please see our step-by-step guide on how to install a WordPress plugin.

Note: You’ll need the Pro version of the All in One SEO plugin to unlock SEO user role features.

Upon activation, the plugin will launch the setup wizard which will walk you through the setup. If you need help, then you can follow our guide on how to set up All In One SEO in WordPress.

Now you can simply add a new user to your WordPress website by visiting Users » Add New page or you can edit an existing user account by visiting the Users » All Users page.

Choose a user for the SEO Manager role

After that, simply click on the Edit link below the user account that you want to change.

On the Edit user screen, scroll down to the Role option and select SEO Editor or SEO Manager user role from the drop down menu.

Choose the SEO Manager from the dropdown menu

Don’t forget to click on the Add / Update User button to save your changes.

These users will now be able to access SEO features based on the user role assigned to them.

For instance, SEO Editor will be able to see and edit SEO Settings for a post or page by simply editing them.

SEO Editor preview

On the other hand, a user with the SEO Manager role will also be able to view the General SEO settings on the WordPress admin sidebar.

They will be able to make changes to site-wide SEO settings that may affect your entire website.

SEO manager dashboard

How to Customize SEO User Roles in WordPress

By default, All in One SEO selects the best access control settings for each SEO user role.

However, sometimes you may want to add or remove permissions from the SEO editor or Manager user roles.

All in One SEO lets you customize SEO user roles so that you can select which options they’ll have access to.

Simply head over to the All in One SEO » General Settings page and switch to the Access Control tab.

Click the Access Control tab on the General Settings page in AIOSEO

Caution: Be very careful when giving a user role access to any option under the General SEO Settings. These options may allow them to apply SEO changes that will affect your entire website.

From here, scroll down to the ‘SEO Editor’ option and toggle the switch next to the ‘Use Default Settings’ option.

This will reveal the Default Settings that All in One SEO has chosen for the SEO Editor role.

Default settings for SEO Editor user role

As you can see that by default the SEO editor user role only has access to Post SEO settings.

From here, you can check or uncheck items that you want to allow the SEO editor to have access to.

For instance, you can remove access to the Manage Redirects option or give them access to the Search Statistics feature.

SEO editor changed settings

Similarly, if you want to change settings for the SEO Manager user role, then you will need to switch off the ‘Use Default Settings’ toggle next to the SEO Manager option.

This will reveal the default settings that All in One SEO has chosen for the SEO manager user role.

SEO manager default settings

By default, the SEO manager user role has access to several options under the General SEO settings as well as all the options under the Post SEO settings.

You can change that by checking the items that you want them to have access to or unchecking to remove access from specific items.

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

We hope this article helped you learn how to add an SEO Editor role in WordPress. You may also want to see our ultimate WordPress SEO guide for beginners and our top picks for the best WordPress plugins for small businesses.

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 an SEO Editor Role in WordPress first appeared on WPBeginner.

How to Add Product Questions And Answers in WooCommerce

Set Up Woocommerce

Are you looking to add a product question and answer section in WooCommerce?

Adding a Q&A section enables customers to ask questions about the product before buying it, and see the questions and answers of other customers. This helps recover abandoned cart sales and improve customer engagement in your store, and reduce support requests.

In this article, we’ll show you how to easily add product questions and answers in WooCommerce.

How to add product questions and answers in WooCommerce

Why Should You Add Product Q&A in WooCommerce

You may have noticed the product question-and-answer section on popular eCommerce websites like Amazon, Target, Best Buy, and more.

Target Q&A example

Adding a product questions and answers section allows customers to ask questions about a product right there on the product page.

You or your customers can then answer that question and it becomes visible to all other new customers who may have the same question in mind.

Over a period of time, your product page will have its own frequently asked questions section, which will help increase sales and reduce abandoned cart rates.

Adding a question and answers section to your online store also allows you to curate user-generated content which improves your WooCommerce product search rankings.

That being said, let’s see how you can easily add product questions and answers to WooCommerce.

1. Adding a Product Q&A Section Using a Premium Plugin

For this method, we will be using the YITH WooCommerce Questions and Answers plugin.

It is a premium plugin and comes with more features to easily add an engaging Q&A section with a better user experience.

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

Upon activation, go to the YITH » License Activation page and enter your license key. You can find this information under your account on the plugin website.

Activate your YITH plugin with the license key

Don’t forget to click on the Activate button after entering your license key.

Next, you need to go to the YITH » Questions and Answers page to configure plugin settings.

YITH Quiestions and Answers settings

From here you need to scroll down to the ‘Question Approval’ option and simply toggle the switch to ‘Yes’.

Once you do that, the questions on the product pages will have to be approved by an administrator before they are displayed on your WooCommerce store.

Toggle the switch next to the Question Approval field

Next, you need to scroll to the ‘Show on Product Tabs’ option.

Here, you need to toggle the switch to ‘Yes’ so that the plugin will automatically add a ‘Questions and Answers’ section to product pages.

Toggle the switch next to the Product on tab field

After that, don’t forget to click the ‘Save Options’ button to store your changes.

Now, you need to switch to the ‘Advanced Settings’ tab.

From here, simply toggle the ‘Vote Question’ switch to ‘Yes’ if you want to allow users to vote on product questions.

Go to the advanced settings tab

Next, you can choose if you want to get an email notification once a question is submitted on your website.

Simply select the ‘Notification in HTML Email’ option from the dropdown menu next to the ‘New question notification’ field.

Tip: To ensure email deliverability you need to use an SMTP server. See our guide on how to fix WooCommerce not sending emails issue.

Similarly, you can also choose the ‘Notification in HTML Email’ option in the ‘New answer notification’ field if you want to receive an email once a question is answered on your site.

Configure the New question notification field settings

Your user can also receive a notification once the question submitted by them is answered.

To enable this, you need to toggle the switch next to the ‘User Notification’ option to ‘Yes’.

Toggle the user notification

After that, you can review other settings. The default options would work for most websites but you can change them if needed.

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

You can now visit your website to see the Questions & Answers section appear on your product pages.

Questions form below product pages

From here, your customers can submit their questions.

Moderating Questions and Adding Answers

You will receive an email notification for new questions submitted by the users. You can also view them by visiting the Questions & Answers » All discussion page.

Moderate question and answers

You can sort entries here by ‘Content not approved’ or ‘Unanswered Questions’.

You can also take your mouse over a question and click ‘Approve’ to make it live.

To add an answer to a question, you can simply click on the ‘Edit’ link below that question. On the edit screen, scroll down to the ‘Your Answer’ section to answer the question.

Add your answer

Repeat the process if you have more unanswered questions.

This is how the product questions and answers section looked on our demo store.

Question and answers preview

2. Adding a Product Q&A Section Using a Free Plugin

If you want to use a free plugin to add a product Q&A section to your WooCommerce store, then this method is for you.

First, you need to do is install and activate the Product Questions & Answers for WooCommerce plugin. For more instructions, see our guide on how to install a WordPress plugin.

Upon activation, click the Product Q&A menu from the WordPress admin sidebar which will direct you to the ‘Product Q&A Settings’ page.

From here, simply check the ‘Load More’ option if you want to add a ‘load More’ button to your product Q&A section.

Adding this button will allow customers to load older questions and reduces the page load time if a product gets a ton of questions.

Simply check the Load more box

Next, you need to choose a page size.

This means that you need to select a default number of questions that are shown in your Q&A section.

All the other questions will be hidden from view. Users will be able to access those questions after clicking the ‘Load More’ button.

You can also change the text used for the ‘Load More’ button to anything you like. For instance, you can call it ‘Load more questions’.

Choose a paging button name

Next, you need to choose a layout for your product Q&A section from the dropdown menu next to the ‘Layout’ option.

You can choose the ‘Normal’ option if you want to display the Q&A section in paragraphs.

Select layout and save your changes

On the other hand, you can also display your questions as an Accordion menu. This means users will need to click on a question to view the answer.

Once finished, don’t forget to click the Submit button at the bottom to save your settings.

Managing Product Question and Answers

After plugin configuration, simply visit any product page on your store. You’ll notice a new Q&A tab added there.

Click Q and A tab on the product page

Clicking on it will display the ‘Q&A’ section where customers can submit their questions.

You will receive an email notification when a user submits a question.

Type a Q&A question and submit it

Now, to answer customer questions, you need to go to the Products » All Products page from the WordPress admin dashboard.

From here, simply click the ‘Edit’ button under a product to open up its’ ‘Edit Product’ page.

Click the Edit button

Next, you need to scroll down to the ‘Product Data’ section and click the ‘Q&A’ tab from the left column.

Here, all the questions submitted on that specific product’s page will be displayed.

Click the Q&A tab

Now, you need to simply type the answer to a customer query in the ‘Answer’ field.

If you want to delete a question because it’s inappropriate or irrelevant to your product, then you can also do that by clicking the Delete icon on the right corner of each question.

You can also uncheck the ‘Approve’ option if you don’t want to display the question on the product page.

Answer or delete the question

After you have answered the product questions, go to the top of the page and click the ‘Update’ button to save your changes.

Now, you can visit the product page to see the Questions and Answer section in action.

Visit site

We hope this article helped you learn how to add product questions and answers in WooCommerce. You can also check out our top picks for the best WooCommerce plugins to grow your store, and our beginner’s guide on how to add web push notification to boost sales.

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 Product Questions And Answers in WooCommerce first appeared on WPBeginner.

How to Display Author’s Twitter and Facebook on the Profile Page

Featured Imgs 23

Want to display your author’s Twitter and Facebook links on their WordPress profile page?

By default, WordPress user profile pages don’t include fields for adding social media profiles such as Facebook or Twitter.

In this article, we will show you how to easily display your author’s Twitter and Facebook profile links in WordPress.

How to Display Author's Twitter and Facebook on the Profile Page

Why Display Author’s Twitter and Facebook Profiles on Your Site?

Social media platforms are an important source of traffic for your WordPress website. That’s why we put together a social media cheat sheet that will help you set up your social media profiles the right way.

Your authors will also have their own social profiles, and you can display them on your site to build credibility with your readers and strengthen your site’s authority.

Your visitors will be able to follow their favorite authors on social media and discover new articles on your site sooner. You can also add their social media profiles to your site’s schema, boosting your site’s trust score on Google and other search engines.

With that being said, let’s take a look at how to display an author’s Twitter and Facebook links on their user profile page.

Some of the best WordPress themes will display an author info box below each article. You can use this feature to display simple links to your author’s social profiles.

Simply go to Users » All Users in your WordPress admin panel and click the name of the author, or the ‘Edit’ link underneath to open the Edit User page.

Click on a User in the All Users List

Next, you should scroll down to the ‘About the user’ section and look for the ‘Biographical Info’ box.

If it is there, then your theme has built-in support for an author box.

Adding HTML Social Links to the User Bio

Here you can type a description of the author using text or HTML. You can manually add HTML links for the author’s Twitter and Facebook profile URLs, like this:

ADD BIO HERE. Follow them on <a href="https:/twitter.com/USERNAME">Twitter</a> and <a href="https://facebook.com/USERNAME">Facebook</a>.

Make sure you add a short biography about the author and change ‘USERNAME’ to their actual Twitter and Facebook usernames.

Once you’re finished, don’t forget to scroll to the bottom of the page and click the ‘Update User’ button to store your settings.

You will now see Twitter and Facebook links with the user’s bio on the posts that they write. Here’s how it looks on our demo website:

Preview of Author Bio with Twitter and Facebook Links

Method 2: Displaying Social Icons With an Author Bio Box Plugin

If your theme doesn’t display an author bio box, or if you want one that is more customizable and displays social icons instead of links, then you can use a plugin.

Simple Author Box is the best free author bio box plugin. It lets you customize nearly every Aspect of your author bio box, including adding social media links for your authors.

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

If you want even more features, then there’s a pro version that lets you display an author box before or after content, add website links, get more social icon styles, include guest authors and co-authors, and more.

Upon activation, the plugin adds social media fields to each user profile. Simply navigate to the Users » All Users page in your WordPress admin area and click on the author’s name or the ‘Edit’ link below.

Click on a User in the All Users List

Tip: To quickly edit your own user profile, you can go to the Users » Profile page.

When you scroll to the bottom of the author profile, you will notice some new fields that have been added by the Author Bio Box plugin.

Scroll until you see the section labeled ‘Social Media Links (Simple Author Box).’ Now you need to select ‘Facebook’ from the drop-down menu, and then paste the URL to their Facebook profile into the next field.

Adding a Facebook Profile Using Author Bio Box

Now you can click the button labeled ‘+ Add new social platform.’

A new drop-down and field will be added where you can add their Twitter URL.

Adding Facebook and Twitter Links Using Simple Author Box

Once you’ve done that, make sure you click the ‘Update User’ button to store your settings.

Note: Don’t worry if the Facebook and Twitter URLs vanish after clicking the button. At the time of writing, there is a minor bug that hides the URLs, but the settings have been saved.

Now Facebook and Twitter icons will be displayed with the author’s profile at the bottom of their posts. Clicking these icons will take your visitors to their social profiles, but these links will open in the same window as your blog.

Preview of Simple Author Box with Social Icons

If you would prefer that the links open in a new tab, then you can navigate to the Appearance » Simple Author Box page and then click on the Elements tab. Once there, you need to find the option to ‘Open social icon links in a new tab’ and toggle it to the on position.

Open Simple Author Box Icons in a New Tab

Now the author’s social profiles will open in a new tab.

Method 3: Adding Social Profiles to Your Site’s Schema for SEO

All in One SEO (AIOSEO) is the original WordPress SEO plugin that’s used on over 3 million websites. It can also be used to add social profile fields on the author’s profile page.

Unlike the other methods, this method will improve your website’s SEO since AIOSEO adds these social profiles to your site’s schema markup.

The problem is that AIOSEO does not automatically display them in the author bio. But don’t worry, we will show you how to do that.

For this tutorial, we’ll use the free version of All in One SEO since it allows you to add social profiles for your website and each user. However, AIOSEO Pro offers even more features to help you rank better in search engine results pages.

The first thing you need to do is install the free All in One SEO Lite plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Once you have the AIOSEO plugin set up, you need to head over to the Users » All Users page, and then click on the author’s name or the ‘Edit’ link just below.

Click on a User in the All Users List

This will open the Edit User page for that author.

Notice that AIOSEO has added a Social Profiles tab at the top of the page. You need to click on that tab now.

All in One SEO Social Profiles Tab

You can now enter the URL to the user’s social profiles in the boxes provided, such as:

https://facebook.com/johnsmith345
https://twitter.com/johnsmith345

Note that simply adding the username is not enough.

Alternatively, if the author uses the same username on multiple social networks, then you can click the box labeled ‘Use the same username for multiple social networks.’

Quickly Adding Multiple Social Networks With Same Username

You can then type in that username and check the social networks it is used on. For other social networks, you can simply type the full URL as before.

Once you are done, click on the ‘Update User’ button at the bottom of the page to store your changes.

Pro Tip: If you have Twitter and Facebook profiles for your business or website, then you can add these to your site’s schema in a similar way by visiting All in One SEO » Social Networks and adding the links on the Social Profiles tab.

The author’s social media profiles have now been added to your site’s schema, helping search engines understand your site better. But they are not yet being displayed on your website.

Displaying AIOSEO Author Twitter and Facebook Links in Your Theme

Now you need to display these fields as links in your theme.

If you are an advanced user, then you can display links from All in One SEO’s social profiles by editing your WordPress theme files. If you haven’t done this before, then check out our guide on how to copy and paste code in WordPress.

Note: If you’re not familiar with editing your theme’s core files and adding custom code, then we recommend you use AIOSEO to add the social profiles to your site’s schema, and then display them on your website using method 1 or method 2 above.

Advanced users can add the following code to your theme files where you want to display the author profile links.

<?php
$twitter = get_the_author_meta( 'aioseo_twitter', $post->post_author );
$facebook = get_the_author_meta( 'aioseo_facebook', $post->post_author );
echo '<a href="' . $twitter .'" rel="nofollow" target="_blank">Twitter</a> | <a href="'. $facebook .'" rel="nofollow" target="_blank">Facebook</a>';
?>

Save your changes and view a post on your website.

Here’s how it looks on our demo website. We added the code snippet to the biography.php file in the template-parts folder of the Twenty Sixteen theme.

Displaying AIOSEO Social Profiles in Your Theme Using Code

We hope this article helped you learn how to display the author’s Twitter and Facebook profile links in WordPress. You may also want to see our guide on how to display recent tweets or how to display your Facebook timeline in 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 Display Author’s Twitter and Facebook on the Profile Page first appeared on WPBeginner.

Beginner’s Guide: How to Center Align a Video in WordPress

Category Image 091

Do you want to center-align a video in WordPress?

By default, if your video’s width is less than your article area, then WordPress automatically aligns it to the left, leaving extra white space on the right side.

In this article, we will show you how to easily center align a video in WordPress.

How to center align a video in WordPress

Why Center Align Videos in WordPress?

When you embed a video in WordPress, it automatically aligns them to the left by default. This is because videos are external content embedded in the content, so WordPress is unable to guess how you would like to display it.

As a best practice, it automatically aligns it to the left, leaving it up to you to adjust the alignment if needed.

By aligning the video to the center, users will have a better experience viewing your content. This way, you won’t have noticeable blank space on the one side of the page, which could give an unprofessional look.

Besides, if you upload videos directly to WordPress, the same thing will happen to them if their width is less than your content area. WordPress will align them to the left by default.

That being said, let’s see how you can easily center-align a video in a WordPress website. We’ll cover both the block editor and classic editor, so you can click the links below to jump ahead to any section.

How to Center Align Video in WordPress Content Editor

If you want your video to fill the width of your content area, then the best way to do this is by adding a YouTube or Vimeo video URL directly in the WordPress content editor.

First, you’ll need to edit a post or a page or add a new one. Once you are in the content editor, simply paste the link to the video. WordPress will embed the video automatically.

Paste video embed code in block editor

Next, select the video block and then click the Change Alignment option. From the dropdown menu, you can choose the position of the video.

WordPress lets you choose from the following alignments:

  • wide width
  • full width
  • align left
  • align center
  • align right.

Go ahead and select the ‘Align center’ option.

Align the video to the center

After that, you can preview and publish your page or post.

The video will now be center-aligned.

Center aligned video preview

However, sometimes for one reason or another, you may need to use the embed code. In that case, you will need to add some simple HTML around your video’s embed code.

First, you need to click the 3 dotted icons in the video block. After that, you can select the ‘Edit as HTML’ option from the dropdown menu.

Edit as HTML

Next, you can enter the following piece of HTML code around the embed code of the video:

<div style="text-align:center;">

/// your video embed code goes here

</div>

Here’s what your embed code would look like with the custom HTML.

Preview of custom HTML code

You can now save your changes and preview the post or page. Your video will be neatly aligned in the center of your content area.

Another approach is to manually increase your video’s width to fit the content area. To achieve this, you need to add or change the ‘width’ parameter in your embed code.

<iframe width="760" height="315" src="https://www.youtube.com/embed/4YpyiJ05YOg" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

How to Center Align Video in the Classic Editor

If you’re using the Classic editor, then you can center align videos by editing a post or creating a new one.

Once you’re in the editor, switch to the Text view. Now enter the following HTML code:

<div style="text-align:center;">

/// your video embed code goes here

</div>

Just make sure to replace ‘your video embed code goes here’ with your video’s embed code.

Once that’s done, it will look something like this:

Center align videos in classic editor

You can now preview and publish your page.

Simply visit your website to see the center-aligned video.

Center aligned video classic editor preview

We hope this article helped you learn how to center align a video in WordPress. You may also want to see our guide on how to start a WordPress blog and must-have WordPress 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 Beginner’s Guide: How to Center Align a Video in WordPress first appeared on WPBeginner.

Image Alt Text vs Image Title in WordPress – What’s the Difference?

Category Image 012
A lot of content on the web includes images. However, not many website owners optimize their images for speed or better search rankings. Even though WordPress comes with the option to add alt text and an image title, often beginners do not understand the difference and how to use them. In this article, we will share the difference between image alt text vs image title in WordPress, so you can improve your image SEO.
Image Alt Text vs Image Title in WordPress - What's the Difference?
Here’s what we’ll cover in this tutorial:

What’s the Difference Between Alt Text and Image Title?

‘Alt text’ is short for ‘alternate text’ and is an attribute that is added to an HTML image tag. The text describes the image, so visitors who can’t see the image and search engine bots will understand what the image is about. If an image on your WordPress website can’t be found or displayed for some reason, then the alt text will be shown instead, as you can see in the following screenshot.
Alt text displayed next to a broken image icon
Alt text is different from the image’s title. The title will be displayed in a small popup box when you bring your mouse cursor over the image.
An image with the title text
Alt text and image titles are also used to improve the accessibility of your website for those with poor vision and who use screen reader devices to read your site’s content. When the screen reader comes to an image, it will read the alt text. Depending on the user’s settings, it may also read the title text. For both accessibility and search engine optimization (SEO), alt text is more important than title text. This is why we strongly recommend including alt text for all your images.

How to Add Alt Text to an Image in WordPress

WordPress allows you to easily add alt text to your images. You can do this from the block editor, the classic editor, or the WordPress Media Library. Adding Alt Text in the Block Editor Simply create a new post or page or edit an existing one, and add an Image block.
Add an Image Block
If you’re not sure how to add a block or you need some extra help with the block editor, then just check out our tutorial on how to use the WordPress block editor. Now you need to upload your image or drag and drop it into the Image block. You can then set the alt text on the right-hand side of the page.
Adding alt text to an image in the WordPress block editor
Adding Alt Text in the Classic Editor If you’re still using the classic WordPress editor, then you can add image alt text when adding the image. First, click on ‘Add Media’ above the posting box.
Click 'Add Media' in the classic editor to add an image to your post
After that, you should either upload the image from your computer or click the ‘Media Library’ tab to view images you’ve already uploaded. Next, click on the image you want in order to select it, and then type the alt text you want into the ‘Attachment Details’ of your image.
Adding alt text to an image in the classic editor
Adding Alt Text in the Media Library You can also add alt text to an image by going to Media » Library and clicking on the image to edit it.
Viewing or editing the alt text for your image in the WordPress media library
Remember, this won’t change the alt text for any instances of that image that you’ve already inserted into posts or pages. However, if you add the image to a post or page after adding alt text here, then the alt text will be included with it.

How to Add Image Titles in WordPress

It’s important to understand that there are two types of titles that you can add to your images. First, there is the default image title WordPress uses internally to identify media files in the Media Library and attachments pages. Second, there is the HTML image title attribute added to images in your posts and pages. Let’s take a look at how to add both types of titles. Adding the WordPress Image Title in the Media Library You can add WordPress media titles to your images using theMedia Library. When you edit an image in the Media Library, you will see a ‘Title’ field.
Adding an Image Title in the WordPress Media Library
This title is used by WordPress to identify the image. When you click the ‘View attachment page’ link at the bottom of the screen, you’ll see the title is used as the title on that page.
Viewing the image's attachment page, with the image title shown
The WordPress media title isn’t necessary for image SEO or for users with screen readers. While it may be helpful in some cases, it’s not as useful as the image’s HTML title attribute. So how do you create that?
Pro Tip: Would you like to automatically use the WordPress media title as the image’s title attribute in your posts and pages? Take a look at the section below where we show you how to do this using All in One SEO Pro.
Adding an HTML Image Title Attribute in the Block Editor It’s easy to add a title attribute in the block editor. Simply click the image and then click the down arrow next to ‘Advanced’ to show the advanced image options.
Adding the Title Attribute in the Block Editor
Now you can simply type the title in the ‘Title Attribute’ field. Adding an HTML Image Title Attribute in the Classic Editor Adding a title attribute using the old classic editor is similar. You can add the title attribute by clicking on an image and then clicking the pencil icon.
Editing an image in the WordPress classic editor
You’ll then see the ‘Image Details’ screen. To set the image title attribute, you need to click the little down arrow next to ‘Advanced Options’ at the bottom.
Click the downward arrow to view the Advanced details for your image
You can then set the image’s title attribute. Make sure you click the ‘Update’ button at the bottom of the screen when you’re done.

How to Automatically Set Alt Text and Image Titles Using AIOSEO

All in One SEO (AIOSEO) is the best WordPress SEO plugin on the market. It will add a proper image sitemap and other SEO features to improve your SEO ranking. It also lets you automatically set your alt text and image titles, and more. The first thing you need to do is install and activate the All in One SEO plugin. For more details, see our step-by-step guide on how to install a WordPress plugin. To use the Image SEO feature, you will need the Plus plan or above. Upon activation, the plugin will launch the setup wizard automatically. You can learn how to configure the plugin in our guide on how to set up All in One SEO correctly. Now you need to navigate to All in One SEO » Search Appearance and then click on the ‘Image SEO’ tab. After that, you’ll have to click the ‘Activate Image SEO’ button to enable the premium image SEO features.
Activating the Image SEO Module in AIOSEO
Setting Image Titles Using All in One SEO Make sure that you are looking at the ‘Title’ tab of the Image SEO page. Here you can choose tags that will set the format used to automatically generate title attributes for your images. For example, if you include the ‘+ Image Title’ tag, then each image in your posts and pages will automatically use the WordPress media title in the HTML title attribute.
Customizing the Image Title in AIOSEO
You can also add other tags, such as your website title, to your image title attribute. All in One SEO can even strip punctuation from the title and change its capitalization. Setting Alt Text Using All in One SEO Next, you need to click the ‘Alt Tag’ tab on the AIOSEO’s Image SEO page. Here you can automatically format the alt text of your images. By default, AIOSEO will simply use the image’s alt text. If you like, you can also add your website’s title and other information to the alt text of each image on your website.
Customizing the Alt Tag in AIOSEO

Why Use Alt Text and Image Titles in WordPress?

We strongly recommend using alt text for all images. Here on WPBeginner, we also add a title to all images. However, this is less important than the alt text. Alt text is important because Google focuses on it as a ranking factor for images. It is also used by screen readers to help visitors with impaired vision to fully engage with your content. You should never just stuff keywords into alt and title tags. It’s important that you make them descriptive and helpful so that they’re useful for visitors who need them. You can use your keywords where relevant, but don’t overdo it. For example, if you’re writing an article about the best WordPress hosting, then your target keyword could be “best WordPress hosting”. You might also have a screenshot in your article showing users how to set up an account with a popular web host like Bluehost. Let’s take a look at some good and bad examples of alt text for that image:
  • “Account setup” is not very descriptive and also doesn’t include anything related to your keyword.
  • “Best WordPress hosting, WordPress hosting, best web hosting for WordPress” doesn’t describe the image and is stuffed with keywords.
  • “Setting up a WordPress hosting account” is much better as it’s descriptive and uses part of the keyword in a natural and appropriate way.
We hope this article helped you understand the difference between image alt text and image title in WordPress. You may also want to learn how to optimize images for the web, and check out our list of the best WordPress SEO plugins and tools. 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 Image Alt Text vs Image Title in WordPress – What’s the Difference? first appeared on WPBeginner.