Categories
Website

How to Let Contributors Edit Their WordPress Posts After Being Approved

Recently one of our readers asked if it was possible to allow contributors to edit their approved posts? WordPress user roles allow you to set different permissions for each user on your site. By default, a WordPress user with a contributor role can’t modify their published posts. In this article, we will show you how to let contributors edit their posts after being approved.

Let Contributors Edit Their Posts After Being Approved

Let Contributors Edit Their Posts After Being Approved

Contributors or guest authors with contributor user role write posts and send them to review in WordPress. A user with the administrator or editor user role can review and publish it. Once published, the contributors are unable to edit their own posts. This is a generalized hierarchy in WordPress that distribute user role and status.

However, you can add or remove capabilities to user roles in WordPress. Let’s take a look at how to let contributors edit their published posts.

Method 1: Allow Contributors to Edit Their Posts (Plugin)

This method is easier and recommended for most users. This method also allows you to edit other user roles and permissions right away.

First thing you need to do is install and activate the Capability Manager Enhanced plugin. For more details, see our step by step guide on how to install a plugin in WordPress.

Upon activation, you need to visit Users » Capabilities in your WordPress admin area to edit capabilities of contributor user role.

User Capabilities

On this page, you need to select Contributor role on the right side, so you can change their permission level.

Select Contributor Role

Once selected, you’ll see a lot of options in this section. In the Editing Capabilities area, you need to select Edit Published option and scroll to the bottom to click on Save Changes button.

Select Edit Published

After that you can test the permissions by switching to a contributor role in WordPress and going to the Posts page. You will now see the option to edit published posts. Hint: you can instantly switch between user accounts while testing roles and permissions in WordPress.

Edit Approved Posts

Method 2: Manually Allowing Contributor to Edit Their Posts

This method requires you to add code to your WordPress files. If you haven’t done this before, then please take a look at our guide on how to copy and paste code in WordPress.

You’ll need to add the following code to your WordPress theme’s functions.php file or site-specific plugin.


// get the "contributor" role object
$obj_existing_role = get_role( 'contributor' );

// add the "Edit published posts" capability
$obj_existing_role->add_cap( 'edit_published_posts' );

This code snippet needs to run only once which means you can save it and then delete it. It will allow contributors to edit their published posts in WordPress.

Even though we have shown you how to allow contributors to edit their published posts, we believe it is not a good practice to let contributors or authors edit their published content.

If there’s a need for any change or correction in the content, then the writer should ask an administrator or editor to update it. This allows you to maintain editorial integrity.

Before publishing a post, an editor checks multiple necessary elements like keywords, images, meta description, URL, and more. These things are important to get better rankings in search results. A user with a contributor user role may not be fully aware of your editorial best practices and can make mistakes that would go unnoticed if not reviewed by an editor or administrator.

One way to deal with this is by sharing a blog post checklist with your contributors and authors. This checklist will help them cover all the tasks before submitting a post to review. It will also help an editor to quickly review a post.

We hope this article helped you learn how to let contributors edit their posts after being approved. You may also want to see our guide on how to allow users to submit posts in WordPress without even accessing the WordPress admin area.

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.



Source link

Categories
Website

How to Better Manage Online Booking in WordPress with StartBooking

Do you want to better manage online booking on your WordPress site? Many WordPress businesses and individuals rely on a booking system to efficiently run their business and manage customers. In this article, we will show you how to better manage online booking in WordPress with StartBooking.

Better manage online booking with WordPress using StartBooking

Why Manage Online Booking in WordPress with StartBooking

Often business websites need an online booking management system to allow customers to book appointments online without calling.

Aside from offering convenience to customers, it also enables you to efficiently manage your time and services. There are plenty of booking plugins for WordPress to choose from. Here are some of the things you should look for in an online booking solution.

  • Does it allow you to easily add booking forms to your website?
  • Are the features customizable enough to match your business?
  • Does it integrate with third-party services like Google Calendar?
  • Does it have smart scheduling to avoid overlapping or incorrect appointments?
  • Does it have the ability to add staff schedules which is highly useful for services like salons, spas, etc?

That being said, let’s see how to easily manage online booking in WordPress with StartBooking.

Managing Online Booking in WordPress with StartBooking

First, you need to visit StartBooking website to create an account. StartBooking is a paid service, but it does offer a free plan for those starting out.

Once you have signed up, you will be taken to your account dashboard. From here you need to click on your account name at the top right corner, so you can access the settings page.

StartBooking dashboard

On the settings page, you need to click on the ‘Hours’ section from the left column and then start saving your business hours for each day.

Adding business hours in StartBooking app

If you run a multi-staff business like spa or salon, then you can add your staff by visiting the users section under account settings. You will be able to edit hours, notifications, and role for each user.

Adding staff users to StartBooking

StartBooking allows you to add multiple services that customers can book for. You can visit the ‘Services’ page where an ‘Example Service’ will already be added for you.

Add and manage services

You can edit or delete the Example Service. You can also create new services as needed.

On the new service page, you can provide a title and description for the service offered. After that, you need to select the duration, cost, user (staff member assigned to the task), and add price.

Add new service

Once you are done, click on the ‘Add Service’ button to save your changes. Repeat the process to add more services if necessary.

Now that you have set your StartBooking account, let’s connect it to WordPress by using their WordPress booking plugin.

Head over to your WordPress site to install and activate the StartBooking plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, the plugin will add a new menu item labeled ‘Booking’ to your WordPress admin sidebar. Clicking on it will take you to the plugin’s settings page.

Connect StartBooking

You need to click on the ‘Connect My Account’ button and log in using your StartBooking account details. Once connected, you will see the plugin’s settings page.

It will automatically create a new page on your WordPress site called ‘Book Now’ and the online booking form shortcode inside it.

Add booking shortcode to page

You can click on the ‘View Page’ link to see your online booking system in action.

Booking page preview

If you have multiple services, then users will first see the option to select a service and then click on continue button. On the next screen, they will be able to select the date and time.

Select date and time

In the next step, customers will provide their contact information and save their appointment.

Customer information

After that StartBooking will see send a confirmation email to the customers, and they will also be able to see their appointment details on screen. You or the staff member assigned for the service will also receive an email notification.

If you don’t want to use the default ‘Book Now’ page created by the plugin, then you can also select any other page on your WordPress site to display your online booking form. Simply add the following shortcode to your page.

[startbooking]

This shortcode will display full booking form flow with services, date, time, and customer information.

You can also create call to action buttons to be used on your services pages. Simply use the following shortcode with a service ID which you can find under the plugin settings.

[startbooking_cta services="4K59oyjEP"]Book Hair Cut[/startbooking_cta]

Service ID

Viewing and Managing Your Online Booking Appoinments

StartBooking not only makes it easy for your users to make a booking, but it also allows you to easily manage your time using a simple dashboard.

Simply head over to the StartBooking website, and you will be able to see all your booked time slots. You can switch the calendar view into day, week, or month to see more appointments or click on an individual appointment to see details.

Appointment details

StartBooking can also integrate into your Google Calendar to sync your appointments. Simply go to your account settings and then click on the ‘Integrations’ tab.

Connect Google Calendar

You need to click on the connect button next to Google Calendar. This will take you to your Google account where you will be asked to give StartBooking access to update your Google Calendar.

Give access to your Google Calendar

Click on the ‘Allow’ button to continue.

After that, you will be able to see all your appointments on your phone using the Google Calendar app.

We hope this article helped find a better way to manage online booking in WordPress. You may also want to see our list of essential WordPress plugins for business websites.

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.



Source link

Categories
Website

How to Create a Product Catalog in WordPress (without a Shopping Cart)

Do you want to create a product catalog in WordPress without adding a full-blown shopping cart? Sometimes businesses want to take order by phone while still displaying their product catalog on the website. In this article, we will show you how to easily create a product catalog in WordPress without a shopping cart.

How to create a WordPress product catalog without shopping cart

Why Add a Product Catalog without Shopping Cart

Some businesses have products that they can’t sell online because they have an undetermined price. This makes it impossible for them to use a shopping cart plugin, but they still want to make a website, so they can showcase those products and attract potential customers.

Normally, people associate eCommerce platforms with online shopping. However, you can still use them to display products without using shopping cart feature.

That being said, let’s take a look at how to easily create a product catalog in WordPress without using the shopping cart feature.

Getting Started with Your Product Catalog in WordPress

The best way to create a product catalog in WordPress is by using WooCommerce. Don’t worry, you will not be using any of its shopping cart features.

If you already have a WordPress website, then you can go ahead and install and activate the WooCommerce plugin. For more details, see our step by step guide on how to install a WordPress plugin.

If you don’t have a WordPress site setup, then see our guide on how to create an online store to quickly set up WordPress with WooCommerce.

Once you have installed WooCommerce, you can move on to creating your product catalog in WordPress.

Creating Product Catalog in WordPress without Shopping Cart

By default, WooCommerce displays an add to cart or buy button next to all your products. This makes it difficult to create a product catalog without the shopping cart feature.

Luckily, there’s an easy solution that fixes this problem.

First, you need to install and activate the YITH WooCommerce Catalog Mode plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit YITH Plugins » Catalog Mode page to configure the plugin settings.

Catalog mode

First, you need to check the box next to ‘Enable YITH WooCommerce Catalog Mode’ option to enable the plugin. After that, you need to choose where you want to hide the ‘Add to cart’ button.

You can choose to hide it on the shop pages or product details pages.

But in this case, you should go with the last option which allows you to disable shop feature everywhere by disabling the checkout page, cart page, and removing all add to cart button everywhere.

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

Adding Products to Your WordPress Product Catalog

You can now go ahead and start adding products to your site. Simply visit Products » Add New page to enter your product information.

Add new product

On the products screen, you can provide product title, description, short description, product image, and product gallery. Under the ‘Product’ data section, you will find the price options. You can leave them blank if you don’t want to display product pricing.

Price options for product

Once you are finished, go ahead and publish your product. Repeat the process to add as many products as needed to build up your catalog.

Viewing Your WordPress Product Catalog

You can visit your WooCommerce shop page to view your default catalog in action. Your shop page is usually located at a URL like this:

http://example.com/shop/

Replace example.com with your own URL to view your WooCommerce shop page in the catalog mode.

Shop page in catalog mode

If you don’t want to use the shop page, then you can also display your products on any WordPress page and use it as your product catalog.

All you have to do is create a new WordPress page or edit an existing one, and add the following shortcode in the content area:

[products columns="4" limit="8" paginate="true"]

Feel free to change the number of columns and the items per page limit to your own requirements. Once you have adjusted the shortcode, go ahead and save or publish your page to preview it.

Product catalog page preview

You will notice that the product pages will not show any add to cart or buy buttons. You can click on any individual product to see the product details page.

Product details page

It will show all the product information images, description, gallery, without an add to cart or buy button.

We hope this article helped you learn how to easily create a product catalog in WordPress without the shopping cart feature. You may also want to see our list of the best WooCommerce themes that you can use for your product catalog 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.



Source link

Categories
Website

The Ultimate Guide to WordPress and GDPR Compliance (in Plain English)

Are you confused by GDPR, and how it will impact your WordPress site? GDPR, short for General Data Protection Regulation, is an European Union law that you have likely heard about. We have received dozens of emails from users asking us to explain GDPR in plain English and share tips on how to make your WordPress site GDPR compliant. In this article, we will explain everything you need to know about GDPR and WordPress (without the complex legal stuff).

WordPress and GDPR Compliance

Disclaimer: We are not lawyers. Nothing on this website should be considered legal advice.

To help you easily navigate through our ultimate guide to WordPress and GDPR Compliance, we have created a table of content below:

Table of Content

What is GDPR?

The General Data Protection Regulation (GDPR) is a European Union (EU) law taking effect on May 25, 2018. The goal of GDPR is to give EU citizens control over their personal data and change the data privacy approach of organizations across the world.

What is GDPR?

You’ve likely gotten dozens of emails from companies like Google and others regarding GDPR, their new privacy policy, and bunch of other legal stuff. That’s because the EU has put in hefty penalties for those who are not in compliance.

Fines

Basically after May 25th, 2018, businesses that are not in compliance with GDPR’s requirement can face large fines up to 4% of a company’s annual global revenue OR €20 million (whichever is greater). This is enough reason to cause wide-spread panic among businesses around the world.

This brings us to the big question that you might be thinking about:

Does GDPR apply to my WordPress site?

The answer is YES. It applies to every business, large and small, around the world (not just in the European Union).

If your website has visitors from European Union countries, then this law applies to you.

But don’t panic, this isn’t the end of the world.

While GDPR has the potential to escalate to those high level of fines, it will start with a warning, then a reprimand, then a suspension of data processing, and if you continue to violate the law, then the large fines will hit.

GDPR Fines and Penalties

The EU isn’t some evil government that is out to get you. Their goal is to protect consumers, average people like you and me from reckless handling of data / breaches because it’s getting out of control.

The maximum fine part in our opinion is largely to get the attention of large companies like Facebook and Google, so this regulation is NOT ignored. Furthermore, this encourage companies to actually put more emphasis on protecting the rights of people.

Once you understand what is required by GDPR and the spirit of the law, then you will realize that none of this is too crazy. We will also share tools / tips to make your WordPress site GDPR compliant.

What is required under GDPR?

The goal of GDPR is to protect user’s personally identifying information (PII) and hold businesses to a higher standard when it comes to how they collect, store, and use this data.

The personal data includes: name, emails, physical address, IP address, health information, income, etc.

GDPR Personal Data

While the GDPR regulation is 200 pages long, here are the most important pillars that you need to know:

Explicit Consent – if you’re collecting personal data from an EU resident, then you must obtain explicit consent that’s specific and unambiguous. In other words, you can’t just send unsolicited emails to people who gave you their business card or filled out your website contact form because they DID NOT opt-in for your marketing newsletter (that’s called SPAM by the way, and you shouldn’t be doing that anyways).

For it to be considered explicit consent, you must require a positive opt-in (i.e no pre-ticked checkbox), contain clear wording (no legalese), and be separate from other terms & conditions.

Rights to Data – you must inform individuals where, why, and how their data is processed / stored. An individual has the right to download their personal data and an individual also has the right to be forgotten meaning they can ask for their data to be deleted.

This will make sure that when you hit Unsubscribe or ask companies to delete your profile, then they actually do that (hmm, go figure). I’m looking at you Zenefits, still waiting for my account to be deleted for 2 years and hoping that you stop sending me spam emails just because I made the mistake of trying out your service.

Breach Notification – organizations must report certain types of data breaches to relevant authorities within 72 hours, unless the breach is considered harmless and poses no risk to individual data. However if a breach is high-risk, then the company MUST also inform individuals who’re impacted right away.

This will hopefully prevent cover-ups like Yahoo that was not revealed until the acquisition.

Data Protection Officers – if you are a public company or process large amounts of personal information, then you must appoint a data protection officer. Again this is not required for small businesses. Consult an attorney if you’re in doubt.

GDPR Data Protection Officer

To put it in plain English, GDPR makes sure that businesses can’t go around spamming people by sending emails they didn’t ask for. Businesses can’t sell people’s data without their explicit consent (good luck getting this consent). Businesses have to delete user’s account and unsubscribe them from email lists if the user ask you to do that. Businesses have to report data breaches and overall be better about data protection.

Sounds pretty good, in theory at least.

Ok so now you are probably wondering what do you need to do to make sure that your WordPress site is GDPR compliant.

Well, that really depends on your specific website (more on this later).

Let us start by answering the biggest question that we’ve gotten from users:

Is WordPress GDPR Compliant?

Yes, as of WordPress 4.9.6, the WordPress core software is GDPR compliant. WordPress core team has added several GDPR enhancements to make sure that WordPress is GDPR compliant. It’s important to note that when we talk about WordPress, we’re talking about self-hosted WordPress.org (see the difference: WordPress.com vs WordPress.org).

Having said that, due to the dynamic nature of websites, no single platform, plugin or solution can offer 100% GDPR compliance. The GDPR compliance process will vary based on the type of website you have, what data you store, and how you process data on your site.

Ok so you might be thinking what does this mean in plain english?

Well, by default WordPress 4.9.6 now comes with the following GDPR enhancement tools:

Comments Consent

WordPress Comments Opt-in for GDPR

By default, WordPress used to store the commenters name, email and website as a cookie on the user’s browser. This made it easier for users to leave comments on their favorite blogs because those fields were pre-populated.

Due to GDPR’s consent requirement, WordPress has added the comment consent checkbox. The user can leave a comment without checking this box. All it would mean is that they would have to manually enter their name, email, and website every time they leave a comment.

Update: If your theme is not showing the comment privacy checkbox, then please make sure that you have updated to WordPress 4.9.6 and are using the latest version of your theme. Also please make sure that you are logged-out when testing to see if the checkbox is there.

If the checkbox is still not showing, then your theme is likely overriding the default WordPress comment form. Here’s a step by step guide on how to add a GDPR comment privacy checkbox in your WordPress theme.

Data Export and Erase Feature

WordPress Data Handling - GDPR

WordPress offers site owners the ability to comply with GDPR’s data handling requirements and honor user’s request for exporting personal data as well as removal of user’s personal data.

The data handling features can be found under the Tools menu inside WordPress admin.

Privacy Policy Generator

WordPress Privacy Policy Generator for GDPR

WordPress now comes with a built-in privacy policy generator. It offers a pre-made privacy policy template and offer you guidance in terms of what else to add, so you can be more transparent with users in terms of what data you store and how you handle their data.

These three things are enough to make a default WordPress blog GDPR compliant. However it is very likely that your website has additional features that will also need to be in compliance.

Areas on Your Website that are Impacted by GDPR

As a website owner, you might be using various WordPress plugins that store or process data like contact forms, analytics, email marketing, online store, membership sites, etc.

Depending on which WordPress plugins you are using on your website, you would need to act accordingly to make sure that your website is GDPR compliant.

A lot of the best WordPress plugins have already gone ahead and added GDPR enhancement features. Let’s take a look at some of the common areas that you would need to address:

Google Analytics

Like most website owners, you’re likely using Google Analytics to get website stats. This means that it is possible that you’re collecting or tracking personal data like IP addresses, user IDs, cookies and other data for behavior profiling. To be GDPR compliant, you need to do one of the following:

  1. Anonymize the data before storage and processing begins
  2. Add an overlay to the site that gives notice of cookies and ask users for consent prior to tracking

Both of these are fairly difficult to do if you’re just pasting Google Analytics code manually on your site. However, if you’re using MonsterInsights, the most popular Google Analytics plugin for WordPress, then you’re in luck.

They have released an EU compliance addon that helps automate the above process. MonsterInsights also has a very good blog post about all you need to know about GDPR and Google Analytics (this is a must read, if you’re using Google Analytics on your site).

MonsterInsights EU Compliance Addon

Contact Forms

If you are using a contact form in WordPress, then you may have to add extra transparency measures specially if you’re storing the form entries or using the data for marketing purposes.

Below are the things you might want to consider for making your WordPress forms GDPR compliant:

  • Get explicit consent from users to store their information.
  • Get explicit consent from users if you are planning to use their data for marketing purposes (i.e adding them to your email list).
  • Disable cookies, user-agent, and IP tracking for forms.
  • Make sure you have a data-processing agreement with your form providers if you are using a SaaS form solution.
  • Comply with data-deletion requests.
  • Disable storing all form entries (a bit extreme and not required by GDPR). You probably shouldn’t do this unless you know exactly what you’re doing.

The good part is that if you’re using WordPress plugins like WPForms, Gravity Forms, Ninja Forms, Contact Form 7, etc, then you don’t need a Data Processing Agreement because these plugins DO NOT store your form entries on their site. Your form entries are stored in your WordPress database.

Simply adding a required consent checkbox with clear explanation should be good enough for you to make your WordPress forms GDPR compliant.

WPForms, the contact form plugin we use on WPBeginner, has added several GDPR enhancements to make it easy for you to add a GDPR consent field, disable user cookies, disable user IP collection, and disable entries with a single click.

GDPR Form Fields in WPForms

Note: We have created a step by step guide on how to create GDPR compliant forms in WordPress.

Email Marketing Opt-in Forms

Similar to contact forms, if you have any email marketing opt-in forms like popups, floating bars, inline-forms, and others, then you need to make sure that you’re collecting explicit consent from users before adding them to your list.

This can be done with either:

  1. Adding a checkbox that user has to click before opt-in
  2. Simply requiring double-optin to your email list

Top lead-generation solutions like OptinMonster has added GDPR consent checkboxes and other necessary features to help you make your email opt-in forms compliant. You can read more about the GDPR strategies for marketers on the OptinMonster blog.

WooCommerce / Ecommerce

If you’re using WooCommerce, the most popular eCommerce plugin for WordPress, then you need to make sure your website is in compliance with GDPR.

The WooCommerce team has prepared a comprehensive guide for store owners to help them be GDPR compliant.

Retargeting Ads

If your website is running retargeting pixels or retargeting ads, then you will need to get user’s consent. You can do this by using a plugin like Cookie Notice.

Best WordPress Plugins for GDPR Compliance

There are several WordPress plugins that can help automate some aspects of GDPR compliance for you. However, no plugin can offer 100% compliance due to the dynamic nature of websites.

Beware of any WordPress plugin that claims to offer 100% GDPR compliance. They likely don’t know what they’re talking about, and it’s best for you to avoid them completely.

Below is our list of recommended plugins for facilitating GDPR compliance:

  • MonsterInsights – if you’re using Google Analytics, then you should use their EU compliance addon.
  • WPForms – by far the most user-friendly WordPress contact form plugin. They offer GDPR fields and other features.
  • Cookies Notice – popular free plugin to add an EU cookie notice. Integrates well with top plugins like MonsterInsights and others.
  • Delete Me – free plugin that allow users to automatically delete their profile on your site.
  • OptinMonster – advanced lead generation software that offers clever targeting features to boost conversions while being GDPR compliant.
  • Shared Counts – instead of loading the default share buttons which add tracking cookies, this plugin load static share buttons while displaying share counts.

We will continue to monitor the plugin ecosystem to see if any other WordPress plugin stands out and offer substantial GDPR compliance features.

Final Thoughts

Whether you’re ready or not, GDPR will go in effect on May 25, 2018. If your website is not compliant before then, don’t panic. Just continue to work towards compliance and get it done asap.

The likelihood of you getting a fine the day after this rule goes in effect are pretty close to zero because the European Union’s website states that first you’ll get a warning, then a reprimand, and fines are the last step if you fail to comply and knowingly ignore the law.

The EU is not out to get you. They’re doing this to protect user’s data and restore people’s trust in online businesses. As the world goes digital, we need these standards. With the recent data breaches of large companies, it’s important that these standards are adapted globally.

It will be good for all involved. These new rules will help boost consumer confidence and in turn help grow your business.

We hope this article helped you learn about WordPress and GDPR compliance. We will do our best to keep it updated as more information or tools get released.

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.

Additional Resources

Legal Disclaimer / Disclosure

We are not lawyers. Nothing on this website should be considered legal advice. Due to the dynamic nature of websites, no single plugin or platform can offer 100% legal compliance. When in doubt, it’s best to consult a specialist internet law attorney to determine if you are in compliance with all applicable laws for your jurisdictions and your use cases.

WPBeginner founder, Syed Balkhi, is also the co-founder of OptinMonster, WPForms, and MonsterInsights.



Source link

Categories
Website

How to Add a GDPR Comment Privacy Opt-in Checkbox in WordPress

Do you want to add a comment privacy optin checkbox in WordPress? European Union’s new GDPR law requires explicit consent for storing user’s personal information. If you have comments enabled on your website, then you need to add a comment privacy checkbox to comply with the new law. In this article, we will show you how to add a GDPR comment privacy opt-in checkbox in WordPress.

How to add comment privacy optin checkbox in WordPress

When and Why Add a Comment Privacy Optin Checkbox in WordPress?

Recently, a new European Union law called GDPR (The General Data Protection Regulation) has become effective. The purpose of this law is to give EU citizens control over their personal data and change the data privacy approach of organizations across the world.

To learn more, see our ultimate guide to WordPress and GDPR compliance which answers all your questions in plain English.

WordPress recently addressed GDPR compliance in the latest 4.9.6 release. If you haven’t updated yet, then you need to immediately update to the latest WordPress version.

One of the ways WordPress stores and uses personal information is in the comment form. When a user leaves a comment on your website, their name, email address, and website information is stored in a browser cookie. This cookie allows WordPress to automatically fill in user’s information in the comment form on their next visit.

With WordPress 4.9.6, the default WordPress comment form will now show a comment privacy opt-in checkbox. All WordPress themes that use the default WordPress comment form will now automatically show this checkbox.

Comment privacy checkbox in default WordPress comment form

If your site is showing the comment privacy checkbox, then you don’t need to read further. However if the comment checkbox is not showing on your site, then you need to continue reading, and we will show you how to add comment privacy checkbox in WordPress.

Adding Comment Privacy Optin Checkbox in WordPress

First, you need to make sure that you are using the latest version of WordPress and your theme. Simply go to Dashboard » Updates page to check for updates.

Check for WordPress and theme updates

If an update is available for your current theme or WordPress, then go ahead and install it. Next, check your website’s comment form to see if the update added the comment privacy checkbox.

If both your theme and WordPress are up to date, and you still can’t see the comment privacy checkbox, then this means that your WordPress theme is overriding the default WordPress comment form.

You can ask your theme author to fix this issue by opening a support ticket. You can also try to fix it yourself until your theme author releases an update.

There are two ways you can add the comment privacy checkbox to your WordPress theme. We will show you both methods, and you can try the one that works for you.

Both methods require you to add code to your WordPress theme files. If you haven’t done this before, then see our guide on how to copy and paste code in WordPress.

Method 1. Add comment privacy checkbox to your theme’s comment form

This method is recommended because it tries to protect your theme’s comment form style and layout.

First, you will need to find the code used to override the default WordPress comment form. Normally, you can find it in the comments.php or functions.php file in your theme folder.

You will be looking for a code using the 'comment_form_default_fields' filter. This filter is used by themes to override the default WordPress comment form.

It will have lines for all of your comment form fields in a specific format. Here is an example code to give you an idea of what you would be looking for:

$comments_args = array(
	        // change the title of send button 
	        'label_submit'=> esc_html(__('Post Comments','themename')),
	        // change the title of the reply section
	        'title_reply'=> esc_html(__('Leave a Comment','themename')),
	        // redefine your own textarea (the comment body)
	        'comment_field' => ' 
	        
', 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' =>'' . '
' . '
', 'email' =>'' . '
' . '
', 'url' =>'' . '
'. '
', ) ), ); comment_form($comments_args); ?>

In this code, you can notice that comment_form_default_fields filter is used to modify the author, email, and URL fields. Inside the array, it uses the following format to display each field:

'fieldname' => 'HTML code to display the field', 
'anotherfield' => 'HTML code to display the field', 

We will add the comment privacy optin checkbox field towards the end. Here is what our code will look like now:

$comments_args = array(
	        // change the title of send button 
	        'label_submit'=> esc_html(__('Post Comments','themename')),
	        // change the title of the reply section
	        'title_reply'=> esc_html(__('Leave a Comment','themename')),
	        // redefine your own textarea (the comment body)
	        'comment_field' => ' 
	        
', 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' =>'' . '
' . '
', 'email' =>'' . '
' . '
', 'url' =>'' . '
'. '
', // Now we will add our new privacy checkbox optin 'cookies' => '', ) ), ); comment_form($comments_args); ?>

Privacy checkbox in a custom WordPress comment form

Method 2. Replacing your theme’s comment form with WordPress default

This method simply replaces your theme’s comment form with the default WordPress comment form. Using this method can affect your comment form’s appearance, and you may have to use custom CSS to style your comment form.

Edit your theme’s comments.php file and look for the line with the comment_form() function. Your theme will have a defined arguments, function, or a template inside it to load your theme’s custom comment form. Your comment_form line will look something like this:


You will need to replace it with the following line:


Don’t forget to save your changes and visit your website. You will now see the default WordPress comment form with the comment privacy optin checkbox.

Default WordPress comment form

We hope this article helped you learn how to add the GDPR comment privacy optin checkbox in WordPress. You may also want to see our tips on getting more comments on your WordPress blog posts.

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.



Source link