Welcome WP101 to the WPBeginner Family of Products

Today, I’m extremely excited to share that WP101 is joining Awesome Motive, and they’re now part of the WPBeginner family of products.

WP101 is one of the most trusted premium WordPress video training providers in the market. Over 3 million users have learned WordPress from their WordPress video tutorials. The WP101 Plugin allows WordPress agencies and service providers an easy way to offer white-labeled professional WordPress training videos to their clients.

WP101 is joining the WPBeginner Family

Introduction to WP101 – Quick Overview

WP101 offers professionally-produced WordPress training videos to help you learn WordPress, fast. It’s a perfect solution for small businesses owners, large corporations, and government agencies who want to offer professional WordPress training videos in their employee onboarding process.

With WP101, you get access to over 200+ WordPress training videos that cover everything you need to learn the WordPress user interface in a university style format.

In addition to the popular WordPress 101 series for both Gutenberg and the Classic Editor, the current library also includes video tutorials for top WordPress plugins including WooCommerce, WPForms, Elementor, Beaver Builder, and more.

WP101 Course Library

The WP101 Plugin makes it easy for WordPress developers and agencies to offer white-label training videos to their clients, right inside the WordPress dashboard.

It gives you the ability to add your own custom videos as well as selective show / hide videos based on client’s needs.

WP101 WordPress Training Videos inside WordPress Dashboard

Whether you’re a small business owner or large corporation, I highly recommend adding WP101 training to your employee onboarding process.

If you’re a WordPress freelancer or agency, then you should consider adding the WP101 Plugin to your client and build a recurring revenue stream.

Background Story – Why WP101? 

Both WPBeginner and WP101 started around the same time with a similar mission: making it easy for people to learn WordPress.

At WPBeginner, we did it with our easy to understand written tutorials, while Shawn at WP101 offered premium video training.

I have been friends with Shawn Hesketh, founder of WP101 for a long time, and we have enjoyed over a decade of coopetition. I have a lot of admiration and respect for the massive impact he’s had in the growth of the WordPress community.

Syed Balkhi and Shawn Hesketh at Pressnomics

After 14+ years of creating WordPress training videos, when Shawn was ready to move on to the next chapter of his life, we started talking about the future of WP101 and carrying his legacy forward.

Given my experience running the largest WordPress resource site, it made perfect sense for us to be the future custodian of the WP101 brand. 

It gives me great joy to be there for a friend and offer him the exit that he deserves as he pursues the next chapter of his career. At the same time, it’s an honor and a privilege that Shawn trusted us to carry the mission forward.

Note: Want to join our remote team to work on something awesome & make an impact? We’re hiring. Come work alongside me and help shape the future of the web.

What’s Coming Next? 

Our work is just starting.

My goal is to create the best class-room style WordPress training videos to help WordPress grow in enterprise, government agencies, as well as at the school and collegiate level. 

I’m really excited about the latter because I believe that education helps level the playing field, and that’s the mission of my Balkhi Foundation.

WordPress is an open source platform, and open source is one of the greatest ideas of our generation. It has the power to transform the lives of so many people across the world, like it did for me when I first immigrated to the US.

While talent is everywhere, opportunities are not. I want to use the WP101 training platform to bring opportunities everywhere, so we can help shape the future of the web for billions worldwide.

This is a big mission, and I need your help. If you have experience with instructional design or higher-ed, I would love to chat with you to see how we can work together to bring WordPress to classrooms and universities. Please send me a message via WPBeginner contact form.

If you’re passionate about teaching WordPress and want to be a part of our mission, we’re hiring content creators and trainers. While the listings for these roles aren’t public, just send me a brief message via our contact form with your resume, and I’ll get in touch with you.

As always, I want to thank you for your continued support of WPBeginner. 

Every time I share an announcement like this, I realize that I’m only able to do what I love every day because of you, our amazing readers, and I’m extremely grateful for your support throughout the years.

WPBeginner and Awesome Motive would not be here without YOU, and I just want to say how much I appreciate all of you.

I look forward to continuing serving you, and the larger WordPress / web ecosystem for years to come.

Yours Truly,

Syed Balkhi
Founder of WPBeginner

P.S. Want us to acquire or invest in your WordPress business? Learn more about the WPBeginner Growth Fund.

The post Welcome WP101 to the WPBeginner Family of Products first appeared on WPBeginner.

All-in-one Google Analytics, Pixels and Product Feed Manager for WooCommerce

If you’re running a WooCommerce store, you know how important it is to understand your customers’ behavior. Tracking customer behavior allows you to identify pain points in your sales funnel, understand what’s driving sales, and optimize your marketing campaigns accordingly. However, tracking customer behavior is easier said than done. With so many different platforms and [...]

Read More...

The post All-in-one Google Analytics, Pixels and Product Feed Manager for WooCommerce appeared first on Learn WordPress with WPLift.

How to Easily Organize Media Uploads by Users in WordPress

Do you want to organize media uploads by user in WordPress?

If you run a multi-author website, then you may want to restrict each author’s media library access to only their own uploads. This can prevent an author from accidentally deleting another user’s images, and help keep subscriber-only content private.

In this article, we’ll show you how to organize media uploads by users in WordPress.

How to organize media uploads by users in WordPress

Why Restrict Author Access to Media Uploads?

If you have a multi-author WordPress blog, then people might be uploading lots of different images. This can make it difficult for an author to find the right image, or they might delete or edit another person’s media file by accident.

This can cause all sorts of problems including poor productivity, lots of extra work for site admins and editors, and a complicated editorial workflow.

This unlimited access can also be a privacy concern. For example, if you’re working on a new product or idea, then other authors might see confidential images in the media library before you make a public announcement.

If you have a WordPress membership site, then contributors and subscribers may be able to access premium media files they shouldn’t have access to. For example, if you sell online courses then a contributor might use their media library access to download premium PDFs and other course materials, without buying a subscription.

That being said, let’s take a look at how to restrict who can see media uploads inside your WordPress admin area. Simply use the quick links below to jump straight to the method you want to use.

Method 1. Organizing Media Uploads by Users With a Plugin (Quick and Easy)

The easiest way to restrict access to media uploads is by using the Frontier Restrict Access plugin.

This free plugin checks whether a user has the edit_others_posts permission, which allows them to edit another user’s posts.

By default, this ability is granted to everyone who has the site admin or editor role. If you want to change this, then you can add or remove capabilities to user roles in WordPress.

If the user doesn’t have this permission, then once this plugin is activated, they won’t be able to access another user’s files in the WordPress media library. This allows you to organize media uploads by users, without restricting access for admins and editors.

This plugin works out of the box and there are no settings for you to configure, so you can simply install and activate the Frontier Restrict Access plugin. For more details, see our guide on how to install a WordPress plugin.

Method 2. Organizing Media Uploads Using Code (Advanced)

Another option is to restrict access to files in the media library using code. This method requires you to add a code snippet to your WordPress blog or website, so it isn’t the most beginner-friendly method. However, you won’t need to install a separate plugin just to organize your media uploads.

Often, you’ll find guides with instructions to add custom code to your WordPress theme. However, this isn’t recommended as mistakes and typos in your code can cause common WordPress errors, or even break your site completely.

That’s why we recommend WPCode.

WPCode is the best code snippets plugin used by over 1 million WordPress websites. It makes it easy to add custom code in WordPress without having to edit the functions.php file.

For this method, we’ll be adding code that checks whether the user has the edit_others_posts permission. If they don’t have this permission, then the code snippet below will stop them from accessing other people’s files in the WordPress media library.

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

Upon activation, head over to Code Snippets » Add Snippet.

How to add custom PHP snippets to your site using WPCode

Here, simply hover your mouse over ‘Add Your Custom Code.’

When it appears, click on ‘Use snippet.’

Adding a custom code snippet to WordPress

To start, type in a title for the custom code snippet. This can be anything that helps you identify the snippet in the WordPress dashboard.

After that, open the ‘Code Type’ dropdown and select ‘PHP Snippet.’

Restricting access to the media library using WPCode

In the ‘Code Preview’ area, paste the following code snippet:

add_filter( 'ajax_query_attachments_args', 'user_show_attachments' );
 
function user_show_attachments( $query ) {
    $user_id = get_current_user_id();
    if ( $user_id && !current_user_can('activate_plugins') && !current_user_can('edit_others_posts
') ) {
        $query['author'] = $user_id;
    }
    return $query;
} 

Next, just scroll to the ‘Insertion’ section. WPCode can add your code to different locations, such as after every post, frontend only, or admin only.

We want to use the custom PHP code across our entire WordPress website, so click on ‘Auto Insert’ if it isn’t already selected. Then, open the ‘Location’ dropdown menu and choose ‘Run Everywhere.’

Running custom PHP code across your website using WPCode

After that, you’re ready to scroll to the top of the screen and click on the ‘Inactive’ toggle, so it changes to ‘Active.’

Finally, click on ‘Save Snippet’ to make the PHP snippet live.

How to restrict access to media files using code

Now, users will only have access to the files they upload to the WordPress media library.

We hope this article helped you better organize media uploads by users on your WordPress site. Next, you can check out our ultimate WordPress security guide or see our expert pick of the best contact form 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 Easily Organize Media Uploads by Users in WordPress first appeared on WPBeginner.

What’s Coming in WordPress 6.2 (Features and Screenshots)

WordPress 6.2 Beta arrived a few days ago and it is expected to be released on March 28th, 2023. It will be the second major release of 2023 and will come with significant new features and improvements.

We have been closely monitoring the development and trying out new features on our test sites.

In this article, we’ll give you a sneak peek into what features are coming in WordPress 6.2 with details and screenshots.

What new features are coming in WordPress 6.2

Note: You can try out the beta version on your computer or on a staging environment by using the WordPress Beta Tester plugin. Please keep in mind that some of the features in the beta may not make it into the final release.

Here is a quick overview of changes coming in WordPress 6.2:

Full Site Editor Comes Out of Beta

The new full site editor feature in WordPress will come out of beta with the final release of WordPress 6.2.

Site editor comes out of beta

This completes a significant part of the WordPress development roadmap.

The site editor feature is now stable for the community to create block-based themes and experiment with their own WordPress websites, plugins, or themes.

Note: Full site editor is available with block themes that support this feature. You can try it out even if you are using the older classic editor with a block-enabled theme.

Browse and Choose Templates to Edit

Previously the Site Editor loaded the Home template of your theme by default. This left many beginners wondering which template or template part they needed to edit.

With WordPress 6.2, the site editor will load the template preview window first. From here, you can browse different templates and see a preview of what it looks like.

Template browser

Then you can simply click on the Edit button to start working on the selected template.

Once you are done editing the template, don’t forget to click on the Save button to make your changes go live.

After that, you can click on the WordPress logo in the upper-left corner of the screen to bring back the template browser sidebar.

Site editor navigation

Now if you need to edit a different template, then you can choose it from here. Otherwise, you can simply click on the WordPress logo again and exit the Site Editor.

Add Custom CSS to Your Theme or Specific Blocks

In the last few WordPress releases, the site editor hid the ‘Theme Customizer‘ which made it difficult for users to add custom CSS to their themes.

WordPress 6.2 will allow users to switch to the Styles panel and select Custom CSS from the menu.

Custom CSS in site editor

From here, users will be able to save Custom CSS that applies to their entire theme.

What if you wanted to save custom CSS that only applied to a specific block?

WordPress 6.2 will also allow you to add custom CSS for specific blocks. From the Style panel, click on the Blocks menu.

Block styles

On the next screen, you will see a list of blocks. Simply click on the block where you want to apply your custom CSS.

Under the block styles, click on the Additional CSS tab.

Block styles custom CSS

If you want to conditionally add CSS or keep your custom styles outside of theme specific settings, then we recommend using the free WPCode plugin.

New and Improved Navigation Menus

Adding navigation menus in the full site editor has been a bit difficult for users. WordPress 6.2 will try to solve this by improving the way users can create and manage menus while using the site editor.

First, instead of editing the menu items inline, you can now add, remove, and edit menu items in a subpanel under the Navigation block.

Managing menu items in block panel

From here, you can add a new menu item by clicking on the Add Block (+) button. You can also just drag and drop menu items to rearrange them.

Want to create a new blank menu or reload an older one? Simply click on the three-dot menu and then choose a menu you created earlier or create a new one.

Manage menus

Colors to Indicate Template Parts Being Edited

WordPress 6.2 will also highlight the template part that you are editing, and that changes will be made on a side-wide, global scale.

The element will be bordered in a color and have a template part icon attached.

Template part editing in site editor

This will help users realize that instead of editing the specific page or post, they are now editing a template part and this change will affect other pages on their site as well.

See Styles for All Blocks in The Style Book

The site editor in WordPress 6.2 will ship with a ‘Style Book.’ Simply switch to the Styles panel and then click on the style book icon.

This will show you all the blocks, and how they are styled in your theme.

Style book shows all block styles at one place

You can locate a block much more quickly this way, and then click to edit it directly.

After that, you can change its appearance and style and customize it to your own requirements.

Edit block directly from style book

Copy and Paste Block Styles

Now that editing block styles and appearance has become so much easier, there is a need to easily copy and paste these styles.

WordPress 6.2 will allow you to simply copy block styles by clicking on block options and then selecting ‘Copy Styles’.

Copy styles

After that, you can click to edit a different block and select ‘Paste styles’ from the block options.

Your browser will ask for permission to allow your website to view the contents of the clipboard. You need to click ‘Allow’ to continue.

Paste styles

Classic Widgets Import as Template Parts in Block Themes

Users with classic widget themes lost their legacy widgets when they switched to a block theme. WordPress 6.2 will provide a nice fallback to that by converting legacy widgets into special Template Parts when switching themes.

You’ll need to enter the site editor and edit the template where you want to import the widgets. After that, create a new template part by clicking on the Add New Block button (+).

Import classic widgets in block themes

From the template part settings panel, click on the Advanced tab to expand it and you’ll find the option to import a widget area from your previous theme.

Separate Sub Panels for Block Settings and Styles

With WordPress 6.2, the editor will show two sub-panels for a block. One for the block settings and the other one for styles.

This will help users understand where they need to look if they want to change the appearance of a block.

Sub panel for Styles

A New Distraction-Free Mode is Introduced

Historically, WordPress has always provided options to hide the formatting buttons and toolbars on the post editor screen.

However, WordPress 5.4 made the editor full-screen by default. This allowed users to have a much cleaner writing interface, but there was no distraction-free mode.

WordPress 6.2 will remedy that and will come with a completely clean and calm distraction-free mode. Users will be able to choose it from the editor settings.

Launch distraction free mode

Once chosen, the distraction-free mode hides all editor control elements.

As you can see below, toolbars, side panels, and the top bar are nowhere to be seen.

Distraction free editor in WordPress 6.2

Improved Pattern Insertion with New Categories

WordPress 6.2 will simplify the Pattern Insertion panel. Instead of showing previews and a drop-down menu of categories, it will show the categories first.

Pattern insertion

There are two new categories of Patterns added for the Header and Footer sections.

Clicking on a category will show you the available patterns that you can use.

Browse patterns in a category

You can then just click to insert a pattern into your template and start editing it.

For more details, see our tutorial on how to use patterns in WordPress.

Miscellaneous Changes

Download Link For Media Files – The media screen will now show a Download File link in the list view.

Download file link in the Media Library

Openverse Integration to Add Free Images – Openverse offers royalty-free open-source images.

With WordPress 6.2, users will be able to find and add those images from Add New panel.

Openverse Integration

New Icon for the Settings Panel – The icon to display the settings panel previously used a gear icon.

It is now represented with a panels icon.

Settings icon

Under The Hood Changes

There are a ton of changes in WordPress 6.2 intended for developers. Here are some of the changes that you will find in the update:

  • Faster updates by moving directories instead of copying them. (Details)
  • A new switch_to_user_locale() function is introduced. (Details)
  • Create autosave revisions only when content is changed. (Details)
  • Add a style variation tag to themes that use style variations. (Details)

Overall WordPress 6.2 beta 1 includes 292 enhancements, 354 bug fixes for the editor, and more than 195 tickets for the WordPress 6.2 core.

We hope this article provided you with a glimpse of what’s coming in WordPress 6.2.

Comment below to let us know what features you find interesting and what you’d look to see in a future WordPress release!

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

The post What’s Coming in WordPress 6.2 (Features and Screenshots) first appeared on WPBeginner.

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

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.

How to Disable Emojis in WordPress (Step by Step)

Are you looking to disable emojis on your WordPress site?

Emojis are small icons that are used to express feelings or emotions. WordPress loads additional CSS and a JavaScript file to add emoji support and some users may want to remove it to improve performance and speed.

In this article, we’ll show you how to easily disable emojis in WordPress.

How to disable emojis in WordPress 4.2

What Are Emojis?

Emojis are the tiny icons or smileys used on the internet.

Originating from Japan, emojis have made their way into the Unicode character set and are now supported by desktop computers as well as iOS and Android mobile devices.

The emojis feature was first introduced in WordPress 4.2 and the primary reason for adding this feature was to add native support for Chinese, Japanese, and Korean language character sets.

Emojis example

By default, WordPress loads an additional JavaScript file and some CSS to add emoji support.

You can see it by viewing your website’s source code or by using the Inspect tool.

Emoji JavaScript in WordPress

However, some site owners may want to disable this extra emoji support to boost WordPress speed and performance by not downloading additional code and scripts.

Note: When we say disabling Emoji in WordPress, we mean disabling the extra checks and scripts used by WordPress to handle Emojis. You can still use Emoji on your site, and the browsers that support them will still be able to display them.

Having said that, let’s take a look at how to easily disable Emoji support in WordPress.

Method 1. Disabling Emojis in WordPress Using Code

For this method, we’ll be using a custom code snippet to disable emoji support in WordPress.

You can add this code snippet to your WordPress theme’ functions.php file or a site-specific plugin. However, a tiny error in the code could easily break your website and make it inaccessible.

To avoid this, we recommend using WPCode. It is the best code snippets plugin for WordPress and offers the safest way to add custom code to your site without breaking it.

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

After activation, simply go to the Code Snippets » All Snippets page from the WordPress admin dashboard.

From here, you need to click the ‘Add New’ button at the top.

Add new code snippet

This will take you to the ‘Add Snippet’ page.

From here, take your mouse over to the ‘Add Your Custom Code (New Snippet)’ option and then click the ‘Use snippet’ button.

Click Use Snippet button

This will bring you to the ‘Create Custom Snippet’ page. You can start by typing a name for your code snippet. It can be anything you like.

After that, you need to select ‘PHP Snippet’ as your ‘Code Type’ from the drop-down menu present in the right corner.

Type a name for your code snippet and choose PHP as code type

Now all you need to do is copy and paste the following code in the ‘Code Preview’ box.

/**
 * Disable the emoji's
 */
function disable_emojis() {
 remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
 remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
 remove_action( 'wp_print_styles', 'print_emoji_styles' );
 remove_action( 'admin_print_styles', 'print_emoji_styles' ); 
 remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
 remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 
 remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
 add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
 add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
}
add_action( 'init', 'disable_emojis' );

/**
 * Filter function used to remove the tinymce emoji plugin.
 * 
 * @param array $plugins 
 * @return array Difference betwen the two arrays
 */
function disable_emojis_tinymce( $plugins ) {
 if ( is_array( $plugins ) ) {
 return array_diff( $plugins, array( 'wpemoji' ) );
 } else {
 return array();
 }
}

/**
 * Remove emoji CDN hostname from DNS prefetching hints.
 *
 * @param array $urls URLs to print for resource hints.
 * @param string $relation_type The relation type the URLs are printed for.
 * @return array Difference betwen the two arrays.
 */
function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {
 if ( 'dns-prefetch' == $relation_type ) {
 /** This filter is documented in wp-includes/formatting.php */
 $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/' );

$urls = array_diff( $urls, array( $emoji_svg_url ) );
 }

return $urls;
}
Paste your code snippet

After that, scroll down to the ‘Insertion’ section to choose an insert method for your code.

Simply select the ‘Auto Insert’ mode so that the code can be automatically executed on your site upon activation.

Choose Auto Insert as insert method

Now go back to the top of the page and toggle the switch on the right from ‘Inactive’ to ‘Active’.

Finally, click the ‘Save Snippet’ button to save your custom code snippet.

Click the Save Snippet button to save changes

That’s all, you have successfully disabled emojis in WordPress.

Method 2. Disable Emojis in WordPress Using a Plugin

For this method, we’ll be using a plugin to disable Emojis in WordPress.

First, you need to install and activate the Disable Emojis plugin. See our guide on how to install a WordPress plugin for more instructions.

The plugin works out of the box and there are no settings for you to configure.

Upon activation, it will automatically disable emoji support from your WordPress site.

We hope this article helped you learn how to disable Emojis on your WordPress site. You may also want to check out our guide on how to create a custom Facebook feed in WordPress and our article on how to add web push notifications to your WordPress 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 Disable Emojis in WordPress (Step by Step) first appeared on WPBeginner.

How to Create Compact Archives in WordPress

Do you want to create compact archives on your WordPress website?

If you have been blogging for a few years, then the list of your posts might have become too long to fit in your WordPress sidebar. This will make your sidebar look cluttered which won’t be good for your site presentation

In this article, we’ll show you how to easily create compact archives in WordPress.

How to create compact archives in WordPress

Why Do You Need Compact Archives in WordPress?

Adding an archive in WordPress allows you to easily display your previously published content on your website for users to go through.

By default, WordPress offers an ‘Archives’ block and widget that can be added to the sidebar of your WordPress blog.

However, the ‘Archives’ block only allows you to display your archives as a long list or a dropdown menu.

A list will make your site look cluttered while a dropdown can be easily overlooked by users as it isn’t as noticeable.

The default archive block in WordPress

By creating compact archives, you can easily display your archives in the WordPress sidebar without taking up much space. You can also display them on your about page or even create a dedicated Archives section.

That being said, let’s take a look at how to easily add compact archives in WordPress.

How to Add Compact Archives in WordPress

You can easily create compact archives in WordPress using the Compact Archives plugin.

First, you need to install and activate the Compact Archives plugin. For further instructions, check out our guide on how to install a WordPress plugin.

Now, the plugin offers three styles to display compact archives on your website.

Style 1. Relaxed three-letter month initials

Style one of the compact archives

Style 2. Compact Monthly Initials

Style two of compact archives

Style 3. Numeric Block

Style three of the compact archives

There are multiple ways to easily display compact archives on your website.

In this tutorial, we will be showing you all four methods and you can choose the one that you like the most.

Method 1. Add Compact Archives in WordPress Posts or Pages

It is super easy to add compact archives to your WordPress page or post because the plugin comes with an easy-to-use block that you can add to your post or page.

For this tutorial, we will be creating a new page for compact archives.

Simply head over to the Pages » Add New page from the admin sidebar. Once a new page opens up in the block editor, you can start by typing a name for your page.

Next, you need to click the ‘Add Block’ (+) button at the top and search for the ‘WPBeginner’s Compact Archvies’ block.

Upon locating it, simply click on the block to add it to your page.

Add the Compact archives block to a page

Next, you need to choose a style for your archives from the Block Settings panel on the right corner of the screen.

Simply choose a style of your liking from the dropdown menu below the ‘Select Archive Type’ option.

Select an archive type from the dropdown menu

You can also choose if you want your archive text to be capitalized or Uppercase.

For that, you need to open the dropdown menu below the ‘Transform Text’ option.

Select the archive text from the dropdown menu

Once you’re satisfied with your choice, simply click the ‘Publish’ or ‘Update’ button at the top.

This is how your archives page will look.

Archives preview

Method 2. Add Compact Archives as a Widget

You can also display your archive as a widget on your website.

Adding the Compact Archives Block in Full Site Editor

If you’re using a block-based theme on your website, then you’ll have to add the ‘ WPBeginners’ Compact Archives’ block using the full site editor.

First, you need to visit the Appearance » Editor page from the admin sidebar to launch the FSE.

From here, you need to click the ‘Add Block’ (+) button on the top-left corner of the screen to open up the block menu.

Next, you need to simply locate and add the ‘WPBeginner’s Compact Archvies’ block to your preferred place on the website.

Add the compact archives block in the FSE

Once you add the block, you can configure its’ style and text settings from the Block Settings panel on the right.

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

Configure the Compact archives settings in FSE

Your compact archives will look like this.

Compact archives in FSE

Adding the Compact Archives Block Using Widgets

If you’re not using a block-based theme, then this method is for you.

First, you need to visit the Appearance » Widgets page from the admin sidebar.

Once there, simply click the ‘Sidebar’ tab to expand it.

Now, you need to click the ‘Add Block’ (+) button in the sidebar tab.

This will open up the ‘Widget Block Menu’ where you need to search for the ‘WPBeginner’s Compact Archive’ block.

Upon locating it, simply click the block to add it in the sidebar section.

Add the compact archives block in the sidebar

Once the ‘Compact Archives’ block is added you can change the style and text of your archive by configuring the settings from the Block Settings panel on the right.

Don’t forget to click the ‘Update’ button at the top to save your changes.

Configure the block settings of the compact archives and click Update button

This is how your website sidebar will look upon adding the ‘Compact Archvies’ block.

Compact archive preview in sidebar

Method 3. Displaying Compact Archives in Template Files

If you are making a custom WordPress theme or want to display archives in a theme template file, Compact Archives comes with handy template tags that you can use.

Simply add the following template tag to your code.

<ul> <?php compact_archive(); ?> </ul>

After adding the tag, compact archives will be added to your page.

However, if you want to add a style to your archive, you can do so by adding the following template tag in your code.

<ul>
<?php compact_archive($style='initial', $before='<li>', $after='</li>'); ?>
</ul>

For example, $style == 'initial' will display only month name initials and should fit right inside a sidebar. Using$style == 'block', will fit the main column of a page. Using $style == 'numeric', will display numeric months.

Method 4. Add Compact Archives to Your HTML Sitemap

If you want to create an HTML sitemap page for your in WordPress, then you can also display compact archives on your HTML sitemap page.

First, you will need to install and activate the All in One SEO for WordPress plugin. For more details see our article on how to install a WordPress plugin.

All in One SEO is the best WordPress SEO plugin on the market. It allows you to easily optimize your website for search engines.

It also comes with an HTML sitemap feature that allows you to easily add an HTML sitemap to your WordPress site.

It is a premium plugin but you can also use the free version called All in One SEO Lite. The free version has fewer features but it includes HTML sitemaps.

Upon activation, the plugin will launch the setup wizard. Simply follow the on-screen instructions to set up the plugin or see our guide on how to properly set up All in One SEO for WordPress.

Once finished, you now need to visit the All in One SEO » Sitemaps page from the admin sidebar.

From here, you need to click on the ‘HTML Sitemap’ tab and make sure that the ‘Enable Sitemap’ toggle is turned on.

Toggle the Enable Sitemap switch

Next, you need to choose how you want to display your HTML sitemap.

For this tutorial, we will be choosing the ‘Gutenberg Block’ option.

If you choose this method, then you’ll have to add the “AIOSEO – HTML Sitemap” block to any page where you wish to display your HTML sitemap.

Choose the Gutenberg block

Next, you need to scroll down to the ‘Compact Archives’ option in the ‘HTML Sitemap Settings’ section.

Here, you need to simply toggle the ‘Compact Archives’ switch to ‘Enabled’.

Now your HTML sitemap will be displayed in a compact date archive format.

Toggle the compact archives switch to Enabled

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

Next, open up a page where you want to display the HTML sitemap from the admin sidebar.

From here, simply click on the ‘Add Block’ (+) button at the top and then add the ‘AIOSEO-HTML Sitemap’ block to your page.

Add the AIOSEO-HTML Sitemap block to your page

Finally, don’t forget to click the ‘Publish’ or ‘Update’ button to save your changes.

Your compact archives HTML Sitemap will look like this.

We hope this article helped you learn how to easily create compact archives in WordPress. You may also want to see our guide on how to easily create an email newsletter in WordPress and our top picks of the best social media plugins to help promote your website.

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 Create Compact Archives in WordPress first appeared on WPBeginner.

Revamp Your WordPress Site with AI-Powered Chat: Get the Best Deal on Adding ChatGPT Plugin Today!

AI was predicted by experts to be a game-changing technology, but only in a distant future. However, with the emergence of ChatGPT, it seems that this future has already arrived. The good news is that there are many practical applications available right now, including the ability to add ChatGPT to your website using the ChatGPT [...]

Read More...

The post <strong>Revamp Your WordPress Site with AI-Powered Chat: Get the Best Deal on Adding ChatGPT Plugin Today!</strong> appeared first on Learn WordPress with WPLift.

9 Best Age Verification Plugins for WordPress (Compared)

Are you looking for a plugin to set up age verification on your WordPress site?

Setting up age restrictions allows you to limit users from seeing content due to legal requirements or the nature of the content. You can set up age verification with the right WordPress plugin without editing any code.

In this article, our expert team have researched and picked the best age verification plugins for WordPress.

Best age verification plugins for WordPress

Why Do You Need an Age Verification Plugin?

If you’re selling products or promoting goods that are age sensitive, then it is important to verify the user’s age before allowing them access.

For example, many countries have laws and regulations that require websites to verify users’ age. This is common if you’re in the business of selling alcohol, tobacco, cannabis, vape, tattoos, and other similar goods.

Similarly, different videos and games are not appropriate for minors and require an age gate. You can also add age verification on your membership website if it contains sensitive content.

A simple way of adding age verification to a WordPress site is by using a plugin. You don’t have to edit any code or hire a developer.

Plus by using a plugin, you can show a confirmation form or a popup where users can enter their age before accessing the content or buying a product.

That being said, let’s look at the best age-verification WordPress plugins for different business needs.

1. WPForms

The WPForms form builder plugin for WordPress

WPForms is the best WordPress contact form plugin that is beginner friendly and lets you create all types of forms. It offers a drag-and-drop form builder and comes with over 500+ pre-built form templates.

WPForms offers a Form Locker addon that allows you to set up age restrictions on your online forms. You can pick age as the verification type for your form and define the age limit. Users will then have to enter their date of birth before they can submit a form on your site.

Enable age verification in WPForms

Using WPForms, you can create forms for all kinds of situations. For instance, the plugin lets you create a login form or a registration form and only allows logged-in users to view the content.

If you’re looking for feedback about your company from a specific age group, then you can create a survey form and add an age restriction. Similarly, you can add an order form on your website with age verification to sell concert tickets or alcohol.

Besides that, WPForms also offers other features and addons. You can integrate payment services like Stripe and PayPal to accept online payments, allow file uploads, connect email marketing services, and more.

Pricing: You will need the WPForms Pro version to access the Form Locker addon and set up age verification in WordPress. This will cost you $199.50 per year. There is also a WPForms Lite version you can use for free.

2. OptinMonster

OptinMonster

OptinMonster is the best lead generation and popup plugin for WordPress. It helps you get more leads, grow your email list, and boost conversions.

You can create stunning campaigns for your site, including age verification popups. The plugin offers a drag-and-drop campaign builder, pre-built templates, and lots of customization options. You can add different elements like images, buttons, videos, and more to your popup.

For instance, you can create a simple age verification lightbox popup with Yes/No options or show a popup where visitors need to enter their date of birth.

Create age verification popup

OptinMonsters also offers fullscreen campaigns, which are great for restricting access to your website or a page until users confirm their age.

The plugin provides powerful display rules that let you choose when and where to show your campaigns. For instance, you can show your age verification campaigns on selected pages or hide the popup for users that have already verified their age on your website.

Besides that, OptinMonster easily integrates with different email marketing services and works with eCommerce platforms like WooCommerce and Shopify.

Pricing: OptinMonster prices start from $9 per month (billed annually). There is also a free version of OptinMonster that you can use to get started.

3. Age Gate

Age gate

Age Gate is a free age verification WordPress plugin that is very easy to use. Using the plugin, you can easily restrict content based on the user’s age.

It offers 3 input options to add age verification in WordPress. You can show a dropdown menu and let visitors select an age, allow users to enter their date of birth, or simply offer a Yes/No option to verify age.

Other than that, you can choose whether to restrict the entire website or select pages based on age. Plus, there is also an option to set different age restrictions for individual content using the plugin.

With Age Gate, you get multiple customization options to edit the appearance of your age restriction message. For instance, you can add a logo, change the background color, add blur, add a background image, and more.

Pricing: Age Gate is a free WordPress plugin.

4. MemberPress

MemberPress

MemberPress is the best membership plugin for WordPress. It lets you create a membership site and sell subscription-based products and services.

With MemberPress, you can add age restrictions to your WordPress site. Let’s say you don’t want members under 18 signing up for a particular membership or course. By setting up an age limit, you can prevent access to content.

Besides that, MemberPress offers other powerful features. It gives you full control over who can access content, release paid content over time, add payment gateways, and more. You can also create and sell online courses using MemberPress’s course builder.

If you want to learn more about setting up a subscription-based website, then please see our ultimate guide to creating a WordPress membership site.

Pricing: MemberPress is a premium plugin with prices starting from $179.50 per year.

5. WooCommerce Age Verification Popup

WooCommerce age verification popup

WooCommerce Age Verification Popup is the next plugin on our list. It is a paid extension for WooCommerce stores. If you have a WooCommerce store and you’re selling products like tobacco, vaping, medicines, fireworks, or items that require age verification, then this plugin is for you.

The plugin offers 4 verification methods where users can simply enter their age, select their date of birth, click a checkbox, or simply select from a Yes/No option.

Besides that, you can choose which pages the popup should appear on. For instance, you can enable it on your entire website or specific pages like cart, checkout, my account, and shopping page.

There are also different customization options you can use to edit your popup. These include adding a background image, selecting a color, adjusting the border height, and text size, and more.

However, if you want more options like prebuilt templates and the ability to add different elements to the popup, then you can use OptinMonster. It also works seamlessly with WooCommerce and offers more powerful display rules.

Pricing: WooCommerce Age Verification Popup is available for $29 per year.

6. Age Verification for WordPress

Age Verification

Age Verification for WordPress is a free WordPress plugin that you can use to add an age limit to your WordPress site. The plugin is beginner friendly and offers basic features.

It adds an age verification popup to your site and restricts access to content for visitors that don’t meet the age requirements. Once a user verifies their age, a cookie is saved for 30 days, so they don’t have to verify their age again.

The plugin offers limited options to edit your age verification box. For instance, you can only add a background image, logo, title text, message text, and edit the yes/no button text using the Age Verification plugin.

However, there are other plugins on our list, like WPForms and OptinMonster, that offer more customization options. Plus, you get to choose from pre-built templates and drag-and-drop builders.

Pricing: The Age Verification plugin is free to use.

7. AgeChecker.Net 

AgeChecker.net

AgeChecker.Net is a third-party age verification platform for eCommerce websites. It uses identity networks and a proprietary database to verify customer’s age at checkout.

The plugin is compatible with different eCommerce platforms, including WooCommerce, Shopify, Magento, BigCommerce, and more.

It adds age verification on checkout pages and instantly verifies 90% of the user’s age in the United States.

If the data isn’t available in the data sources, then it will ask for the customer’s ID verification. Once a customer submits the required documents, AgeChecker.Net’s 24/7 live team manually verifies it for you. If the customer is underage, they will disable their access to the product or service.

Other than that, you can customize the minimum age, digital signature requirements, and order blocking based on the customer’s location. Plus, the plugin is compliant with Food and Drug Administration (FDA) and other federal and state regulations in the US.

Pricing: AgeChecker.Net has a free WordPress plugin that connects with WooCommerce. However, you will need to signup for their premium plan, which will cost you $25 per month + 50¢ per accepted verification.

8. AgeVerify

AgeVerify

AgeVerify is another WordPress age verification plugin that is free to use. The plugin is super simple to use and lets you create an age-verification message for your website.

It comes with prebuilt templates that you can use for different types of businesses. Plus, you can edit the age verification text, change the text and color of the button, and more.

What makes this plugin different from others on our list is that it lets you edit the cookie duration (in hours) for the age verification message. This way, your visitors won’t have to verify their age each time they visit your website.

Pricing: AgeVerify is a free WordPress plugin.

9. Easy Age Verify

Easy Age verify

Easy Age Verify is an age verification plugin for WordPress that comes with pre-built verification settings and messages for alcohol, vape, and adult businesses.

The plugin is super easy to use and doesn’t require complex configuration. All you need to do is enable age verification, select your industry, and the plugin will take care of the rest. It also gives you the option to exclude age verification for logged-in users.

On the downside, you cannot customize the appearance of your age verification message in the free version. However, you can use WPForms as an alternative. It helps display a custom age verification form anywhere on your website.

Pricing: Easy Age Verify is free to use. There is also a premium version that unlocks customization features, and it costs $8.25 per month (billed annually).

Which is the Best Age Verification WordPress Plugin?

Our top picks for the best age verification plugin for WordPress are WPForms and OptinMonster.

WPForms offers a Form Locker addon that allows you to add an age gate on any type of form and display it anywhere on your site. It offers a drag-and-drop form builder, prebuilt templates, and lots of customization options.

On the other hand, if you’re looking to add an age verification popup on your WordPress site, then OptinMonster is the best option. It lets you create age verification popups, offers powerful targeting rules to show and track that campaign, and easily integrates with eCommerce platforms.

We hope this article helped you find the best age verification plugin for WordPress. You may also want to see our post on the best live chat software for small businesses and proven ways to make money online blogging with 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 9 Best Age Verification Plugins for WordPress (Compared) first appeared on WPBeginner.

How to Stop WordPress From Overwriting .htaccess File

Recently one of our readers asked if it was possible to stop WordPress from overwriting the custom code in your .htaccess file?

WordPress along with several plugins add custom settings to the .htaccess configuration file. If you have added your own custom code to .htaccess, then you may be worried that it will be overwritten or deleted.

In this article, we’ll show you how to stop WordPress from overwriting the .htaccess file.

How to Stop WordPress From Overwriting .htaccess File

Why Does WordPress Overwrite the .htaccess File?

Your .htaccess file is a powerful configuration file that stores important settings about your WordPress website. It contains rules that tell your hosting server how to handle your site.

WordPress uses the .htaccess file to store its permalink settings. Whenever you change or regenerate your permalinks, WordPress will automatically overwrite the old settings in .htaccess with the new settings.

Some WordPress plugins also save their settings in .htaccess. For example, the W3 Total Cache plugin will modify your .htaccess file in order to configure the caching and optimization tools that are part of the plugin.

Lastly, you can make your own custom changes to .htacess to control how your website works. For example, you can add custom rules to the file that protect your admin area, keep your site safe from hackers, set up redirects, ban suspicious IP addresses, and more.

Some users are concerned that if they add their own custom rules to .htaccess, then they may be deleted when WordPress overwrites the file with new settings. Other users prefer to manually configure .htaccess and not let WordPress write to it at all.

With that being said, let’s take a look at how to stop WordPress from overwriting your .htaccess file. Simply use the quick links below to jump to the section you are interested in.

How to Stop WordPress From Overwriting Your .htaccess Rules

The good news is that if you understand how the .htaccess file works, then you can be confident that your custom rules will not be overwritten.

That’s because the areas of the file that will be changed by WordPress or your plugins are clearly marked. Simply make sure that you don’t add code to those areas.

Don’t Modify Code Inside the WordPress Markers

As we said earlier, WordPress uses .htaccess to store the settings for an SEO-friendly URL structure. The code it saves to the file will be automatically overwritten and updated whenever you change your permalink settings.

As you can see in the screenshot below, WordPress saves this information between two markers, # BEGIN WordPress and # END WordPress.

WordPress Markers in .htaccess

Notice the warning inside those markers:

The directives (lines) between “BEGIN WordPress” and “END WordPress” are dynamically generated, and should only be modified via WordPress filters. Any changes to the directives between these markers will be overwritten.

This means that WordPress will not overwrite or modify any code that you add outside these markers. Users typically add their custom code to the top of the file, above the # BEGIN WordPress marker.

Tip: .htaccess is a hidden file located in your WordPress site’s root folder. If you are having difficulties finding it, then take a look at our guide on why you can’t find the .htaccess file on your WordPress site.

Don’t Modify Code Inside Your Plugins’ Markers

When a plugin saves its settings to .htaccess, it also places it between markers that look like # BEGIN Plugin and # END Plugin.

For example, if you install and set up the W3 Total Cache plugin to improve your website speed and performance, then it will add rules to .htaccess between # BEGIN W3TC Browser Cache and # END W3TC Browser Cache markers.

Example of Plugin Markers in .htaccess

These rules will be overwritten whenever you change the plugin’s settings, so you need to be careful not to add your own custom .htaccess rules between those markers.

Creating Markers for Your Custom Code

In rare cases, a badly behaved plugin may modify code outside of its # BEGIN and # END markers. However, it will normally not modify code found between the markers used by WordPress or other plugins.

If you are concerned about a badly behaved plugin overwriting your code, then you can add your own markers to the .htaccess file.

For example, you can type # BEGIN MyCustomCode and # END MyCustomCode markers at the top of the .htaccess file, and then add your own custom rules between those markers.

You Can Create Your Own Markers in .htaccess for Your Custom Rules

If you also need to add code to the end of .htaccess, then you can add a different set of markers there. Just be sure to give them different names. For example, you could use ‘MyCustomCodeTop’ and ‘MyCustomCodeBottom’.

How to Stop WordPress From Modifying .htaccess

Now that you understand how .htaccess works, you can be confident that your custom code will not be overwritten by WordPress or your plugins.

However, some developers and advanced users want to stop WordPress from making any changes to .htaccess.

For example, they may want to create permalinks by typing the settings manually into .htaccess. In this case, they will want to avoid conflicts by stopping WordPress from saving its own permalink settings to the file.

We don’t recommend this unless you know what you’re doing, because it can lead to unexpected consequences. However, it can be done by changing the file’s permissions or using code.

Stopping WordPress From Changing .htaccess Using File Permissions

One way to stop WordPress from modifying .htaccess is to make the file read-only. To do this, you need to change the file permissions using an FTP client or the file manager provided by your WordPress hosting provider.

You will find the .htaccess file in the root directory of your WordPress installation. Next, you should right-click the file and select ‘File permissions’.

Selecting File Permissions From the Menu in Your FTP Client

This will display a pop-up where you can change the file’s attributes.

The default setting will be 644, but you can change this to 444 by typing directly into the ‘Numeric value’ field or making sure that only the ‘Read’ boxes are checked.

Changing the .htaccess File Permissions to 444 or Read-Only

Once you click the ‘OK’ button, the file will be read-only and cannot be modified.

Of course, this will mean that you are unable to write to the file as well. When you wish to make changes, you will need to temporarily set the file permissions back to 644.

Stopping WordPress From Changing .htaccess Using Code

Another solution is to use a code snippet that lets WordPress know not to write to the .htaccess file. This is useful if you want to stop WordPress from modifying .htaccess without blocking your plugins.

Note: Editing any core WordPress files can be dangerous. Even a small mistake can cause major errors on your site. That’s why we only recommend this method for advanced users.

Simply add the following code snippet at the end of your wp-config.php file. If you need help, then please refer to our guide on how to edit the wp-config.php file in WordPress.

add_filter('got_rewrite', '__return_false');

Once you’ve done that, WordPress will no longer write to the .htaccess file.

Error Message Displayed When WordPress Can’t Change .htaccess

If you try to change your permalink settings when .htaccess is set to read-only, then an error message will be displayed.

At the top of the Settings » Permalinks page, you will see the message ‘You should update your .htaccess file now.’

Permalink Settings Error Message When .htaccess Cannot Be Accessed

This lets you know that WordPress was unable to modify the .htaccess file.

Normally, this is what you intended. However, if you do wish to add the WordPress permalink settings to .htaccess, then you will need to do it manually.

At the bottom of the Settings ≫ Permalinks page, you will see another error message saying that your .htaccess file is not writable. Underneath that, you will see the rules that need to be added to .htaccess.

List of Rules You Will Need to Add to .htaccess Manually if Needed

If you wish to add those settings, then you will need to temporarily change the .htaccess file permissions back to 644 so that it can be edited. After that, you should paste the rules between the file’s WordPress BEGIN and END markers, replacing the code already there.

When you’re finished, simply set the value back to 444 and save the file. It will once again be unwritable.

We hope this tutorial helped you learn how to stop WordPress from overwriting the .htaccess file. You may also want to learn how to add push notification in WordPress and check out our expert 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 How to Stop WordPress From Overwriting .htaccess File first appeared on WPBeginner.