Tag: tutorials

  • How to Validate Customer Phone Numbers (2 Ways)

    Are you looking for ways to validate your customer’s phone numbers?

    Phone number verification helps filter invalid leads before they’re added to your database. This way, you’ll save time and cost by only removing fake or inactive numbers.

    In this article, we will show you how to validate customer phone numbers using different ways.

    How to validate customer phone number

    Why Validate Customer Phone Numbers?

    If you collect customer phone numbers as part of lead generation, then it is important to validate the contact information.

    Sometimes, a user might make an error when entering the phone number, providing a fake number, or the number is no longer active. It’s important to verify this information and make sure that your efforts don’t go to waste.

    That’s because you can use a valid phone number to provide customer support through a business phone service, deliver shipping details, order information, marketing and sales-related activities, and more.

    Plus, you’ll also reduce costs by removing invalid contact information. This is really useful when you’re using marketing tools to send SMS messages, emails, and other messages, as you’ll save credits.

    That said, let’s see how to validate customer phone numbers in WordPress. We’ll cover different methods, so you can click the links below to jump ahead to any section.

    Method 1: Validate Phone Numbers using WP Simple Pay

    If you’re selling digital products online, then you can verify the customer’s phone number using WP Simple Pay. It is the best Stripe payment plugin for WordPress and allows you to accept online payments without setting up a shopping cart.

    The plugin offers a phone number validation feature that confirms if a user has entered the phone number correctly. This way, you can reduce the likelihood of typos and errors.

    For this tutorial, we will use the WP Simple Pay Pro plan because it includes the phone number validation feature. However, there is also a free version of WP Simple Pay available.

    First, you’ll need to install and activate the WP Simple Pay plugin. If you need help, then please see our guide on how to install a WordPress plugin.

    Upon activation, you’ll see the WP Simple Pay setup wizard. Simply click the ‘Let’s Get Started’ button to continue.

    WP Simple Pay

    On the next screen, you’ll need to enter the license key. You can easily find the key in your WP Simple Pay account area.

    After entering the license key, you can click the ‘Activate and Continue’ button.

    You’ll Be Asked to Enter Your WP Simple Pay License Key

    Next, you must connect your Stripe account with WP Simply Pay.

    Go ahead and click the ‘Connect with Stripe’ button to move forward.

    Connecting WP Simple Pay to Stripe

    You’ll now need to login to your Stripe account and follow the onscreen instructions to connect your account.

    Do note that Stripe only works with sites with SSL encryption. Most WordPress hosting services provide free SSL certificates. However, you may also want to see our guide on how to move a website from HTTP to HTTPS.

    Once you’ve connected your Stripe account, the setup wizard will ask you to configure the email settings. You can enable options to receive payment receipts, upcoming invoices, and payment notifications.

    Configure Your WP Simple Pay Emails

    Go ahead and click the ‘Save and Continue’ button when you’re done.

    Now, you’re ready to create a payment form in WP Simple Pay. Simply click the ‘Create a Payment Form’ button.

    WP Simple Pay Setup Is Complete

    WP Simple Pay offers multiple form templates to choose from. You can simply add a payment button, donate button, or set up all types of payment forms.

    For this tutorial, we will select the ‘Payment Form’ template. You can hover over the template and click the ‘Use Template’ button.

    Select the Payment Form Template

    Next, you can edit your payment form.

    In the General settings tab, you’ll see options to change the form title, description, form type, payment success page settings, and more.

    Edit payment form general settings

    After that, you can switch to the ‘Payment’ tab.

    Here, you will see different settings to edit the pricing options.

    Change the pricing options

    You can scroll down to add prices for your products. Plus, there are also settings to choose the subscription type. For instance, you can make it a one-time payment or a recurring subscription.

    WP Simple Pay also lets you add different payment methods. You can accept payments through credit/debit cards, ACH direct debit, Aplipay, Klarna, and more.

    Add prices and payment methods

    After that, you can switch to the Form Fields tab to add or remove different fields in your payment form.

    By default, WP Simple Pay won’t add the phone number field.

    To add the field, simply click the Form Fields dropdown menu and select the ‘Phone’ field. Once you’ve selected it, click the ‘Add Field’ button.

    Add phone number form field

    Next, you can expand the Phone field and further customize it, like editing its label and making it a required field.

    For phone number verification, make sure that you enable the ‘Offer Smart Phone Number Validation’ option and select the default country.

    Edit phone number field

    Aside from that, you can edit other form fields and rearrange their order by simply dragging them up or down.

    Once you’re done editing, go ahead and click the ‘Publish’ button.

    Publish your payment form

    Next, you can add the payment form on any page or post on your WordPress site.

    Simply edit or add a new post or page. Once you’re in the content editor, click the ‘+’ icon and add the ‘WP Simple Pay’ block.

    Add a WP Simple Pay block

    Now, click the dropdown menu in the block to select your payment form. Once that’s done, simply publish or update your page.

    You can now visit your website to see the payment form with the phone number validation option.

    Payment form with phone validation

    When a user enters an invalid phone number, they will not be able to move ahead in the form.

    Method 2: Validate Phone Numbers using Formidable Forms

    Another way to verify your customer’s phone numbers is using Formidable Forms. It is one of the best contact form plugins for WordPress. It offers powerful features and helps you create complex forms, like mortgage calculators.

    Formidable Forms lets you add a phone number field to your forms and helps validate the numbers. You can also select a format, so users enter the correct information without making any mistakes. This is really useful if you’re collecting leads or gathering user information on a WordPress blog.

    For this tutorial, we will be using the Formidable Forms Pro version because it includes advanced settings for phone validation.

    First, you’ll need to install and activate the Formidable Forms Lite plugin, which acts as a base for advanced premium features. For more details, please see our guide on how to install a WordPress plugin.

    Upon activation, you can head to the Formidable » Global Settings. Here, you will need to click the ‘Click to enter a license key manually’ link.

    Formidable Forms license key

    After that, simply enter the license key in the box and click the ‘Save License’ button.

    You can find the license key in your Formidable Forms account area.

    Enter Formidable Forms license key

    Now, you’re ready to create a new WordPress form.

    Next, you can go to Formidable » Forms from the WordPress dashboard and click the ‘+ Add New’ button.

    Creating a new form sing Formidable Forms

    After that, Formidable Forms will ask you to select a form template. There are multiple templates to choose from.

    For this tutorial, we will use the ‘Contact Us’ form template.

    Select formidable forms template

    Next, you’ll see the drag-and-drop form builder, where you can edit your contact form.

    From the panel on your left, simply drag the ‘Phone’ field and drop it onto the template.

    Add the phone form field

    You can now select the Phone form field and further customize it.

    For instance, there are options to change its label, make it a required field, and enter CSS classes.

    Edit the phone form field

    Next, you can open the ‘Advanced’ tab from the panel on your left.

    Here, you can set the format for your phone number. This will help users to fill in the contact information correctly. Besides that, there are other options to add placeholder text, edit the field size, add max characters, and more.

    Edit advanced form settings

    Lastly, you’ll need to switch to the ‘Validation Messages’ tab from the left panel.

    In this section, you can enter the message that customers will see when they enter an invalid format.

    Enter validation message

    Other than that, Formidable Forms also offers different settings for your WordPress form.

    You can switch to the ‘Setting’ tab from the top to view them. For instance, there are options to edit the actions and notifications for your form.

    By default, Formidable Forms will send a confirmation message when a user submits a form. Plus, your website admin will also receive an email that a new form has been submitted.

    Edit formidable form settings

    After making changes to the form settings, you can embed in any page or post.

    Simply click the ‘Embed’ button at the top. A new window will now open where you’ll need to select an existing page, create a new page, or manually insert the form on your website.

    Embed your form

    For this tutorial, we will select the ‘Create new page’ option.

    Next, you’ll need to enter a name for the new page. Once that’s done, click the ‘Create page’ button.

    Enter a name for your form page

    You should now see a preview of your form in the WordPress block editor.

    Go ahead and publish your page. You can visit your website to see the contact form with the phone number validation field.

    View contact form with phone number

    Now, if someone enters the phone number with an invalid format, they won’t be able to submit the form and will see the validation message.

    We hope this article helped you learn how to validate customer phone numbers. You may also want to see our guide on the best live chat software for small businesses and our ultimate guide to WordPress SEO.

    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 Validate Customer Phone Numbers (2 Ways) first appeared on WPBeginner.

    Go to source

  • How to Make Separate RSS Feeds for Each Category in WordPress

    Do you want to make a separate RSS feed for each category in WordPress?

    Categories allow you to easily sort your content into major sections. Adding category RSS feeds can help your users subscribe to specific areas of your website that interest them.

    In this article, we will show you how to easily make a separate RSS feed for each category in WordPress. We will also talk about how you can use these feeds effectively to grow your website.

    How to make separate RSS feeds for each category in WordPress

    How to Find RSS Feeds for Different Categories in WordPress

    Categories and tags are two of the main default taxonomies in WordPress. They allow you to easily sort and organize your content into different subjects and topics.

    By default, each category on your WordPress website has its own RSS feed. You can locate this RSS feed by simply adding ‘feed’ at the end of the category page URL.

    For instance, if you have a category called ‘News’ with a URL like this:

    https://example.com/category/news/

    Then its RSS feed would be located at the following URL:

    https://example.com/category/news/feed/

    Tip: You can find your category URL by visiting the Posts » Categories page and clicking on the ‘View’ link under a category.

    View Category URL by clicking on the View link

    Now that you have located the RSS feed URLs for your categories, let’s look at some of the ways that you can share them with visitors on your WordPress website.

    If you want to add links to your category RSS feeds using the default WordPress settings, then this method is for you.

    First, you will need to open up a page or post where you want to add the RSS feed links in the block editor.

    Once you are there, you can type the name of all the categories on your website in a List block.

    After that, simply click the ‘Link’ icon in the block toolbar to open up the link prompt.

    Click the Link icon in the block toolbar

    Here, you can type the URL for your category RSS feed.

    You will need to repeat this process for each category RSS feed on your website by linking to it on the related name within the List block.

    Add category RSS feed links

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

    You have now manually created a list of links to all your category RSS feeds. Now, you can visit your website to see these RSS feed links in action.

    Category RSS feed preview

    However, keep in mind that if you want to add, delete, or merge categories in the future, then you will have to manually update this list again.

    Method 2: Add Links for Category RSS Feeds Using WPCode (Recommended)

    If you want to create a list of category RSS feed links that are automatically updated every time you make changes, then this method is for you.

    To add URLs to the category RSS feed, we will need to add custom code to your website theme’s functions.php file. However, even the smallest error in the code can break your site, making it inaccessible.

    We recommend always using WPCode when adding custom code to your website. It is the best WordPress code snippet plugin that makes it safe and easy to add custom code without manually editing your functions.php file.

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

    Note: You can also use the free WPCode plugin for this tutorial. However, upgrading to the pro WPCode plugin will give you access to a cloud library of code snippets, smart conditional logic, and more.

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

    Next, click on the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

    Add new snippet

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

    This name is only for your identification and won’t be used on the website’s front end.

    Next, you need to select ‘PHP Snippet’ as the code type from the dropdown menu on the right corner of the screen.

    Choose PHP Snippet as code type for category RSS feed

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

    function wpbeginner_cat_feed_list() {
    	$string = '<ul>';
    	$string .= wp_list_categories( array(
    		'orderby'    => 'name',
    		'show_count' => true,
    		'feed_image' => '/path/to/feed-image.png',
    		'echo' => false,
    	) );
    	$string .= '</ul>';
    
    	return $string;
    }
    
    add_shortcode( 'wpb-cat-feeds', 'wpbeginner_cat_feed_list' );
    

    Once you have done that, you can now also choose an icon image that will be displayed next to your category RSS feed links.

    To do this, simply replace the /path/to/feed-image.png line in the code with the URL of your preferred icon image for the feed links.

    Paste the code for adding links for category RSS feeds

    Keep in mind that the icon image will first need to be uploaded to your WordPress media library.

    Once it’s uploaded, you can get its URL by visiting the Media » Library page from the admin sidebar and clicking on the icon image to view its attachment details.

    Copy image link from the media library

    After adding the URL for the icon image to the code, scroll down to the ‘Insertion’ section.

    From here, select the ‘Auto Insert’ method so that the code will be executed automatically on the website page where you add a shortcode.

    Note: Keep in mind that even after choosing the ‘Auto Insert’ mode, you will need to add a [wpb-cat-feeds] shortcode to the page where you want to list categories RSS feeds. This shortcode is not the WPCode ‘Shortcode’ feature, but a part of the code snippet itself.

    Choose an insertion method

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

    Finally, click the ‘Save Snippet’ button to store your settings.

    Save the code snippet for adding RSS feed links to categories

    After that, you need to open up the page or post where you want to add the category RSS feed links in your WordPress block editor.

    From here, click the ‘Add Block’ (+) button at the top left corner of the screen and locate the ‘Shortcode’ block.

    Upon adding the block, simply copy and paste the following shortcode into it.

    [wpb-cat-feeds]

    Add shortcode

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

    Now visit your website to check the category RSS feed links in action.

    Preview for category RSS feeds

    Method 3: Display RSS Feed Subscription Option on the Category Pages

    If you want to add a Subscribe link at the top of all your category pages, then you can use this method.

    To do this, you will need to add custom code to your WordPress category.php or archive.php theme template.

    However, it can be risky, and the smallest error can break your website.

    This is why we recommend using WPCode instead. It is the easiest and safest way to add custom code to your WordPress website.

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

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

    Next, head over to the ‘Add Your Custom Code (New Snippet)’ option and click the ‘Use Snippet’ button under it.

    Add new snippet

    Once you are taken to the ‘Create Custom Snippet’ page, start by typing a name for your code snippet.

    It can be anything you like and is only for your identification purposes.

    After that, select ‘PHP Snippet’ as the code type from the dropdown menu on the right.

    Choose PHP code type for code snippet to add subscription links to category pages

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

    <?php
    if ( is_category() ) {
    $category = get_category( get_query_var('cat') );
    if ( ! empty( $category ) )
    echo '<div class="category-feed"><p><a href="' . get_category_feed_link( $category->cat_ID ) . '" title="Subscribe to this category" rel="nofollow">Subscribe</a></p></div>';
    }
    ?>
    
    Paste the code snippet for adding subscription link

    Upon adding the code, scroll down to the ‘Insertion’ section and choose the ‘Auto Insert’ method.

    This way, the code will automatically be executed on your website.

    Choose an insertion method

    Next, you have to open up the ‘Location’ dropdown menu and switch to the ‘Page-Specific’ tab from the column on the left.

    After that, select the ‘Insert Before Excerpt’ option as the snippet location.

    Choose snippet location as Insert before excerpt

    Once you have done that, scroll back to the top and toggle the ‘Inactive’ switch to ‘Active’.

    Finally, click the ‘Save Snippet’ button to save your changes.

    Save snippet for adding subscription link to category pages

    Now, you can visit your website category page to view the Subscription link for the RSS feeds in action.

    This is what it looked like on our demo website.

    Preview for subscription link

    How to Optimize Category RSS Feeds in WordPress

    Category RSS feeds allow your users to subscribe only to content that interests them the most.

    For instance, if you have a technology news blog, then your users can choose to subscribe only to news about the devices that they use.

    However, a plain RSS feed isn’t readable without a feed reader, and most users aren’t using one to subscribe to their favorite websites.

    Luckily, you can still use your category feeds to deliver content to your users anywhere they want.

    For example, you can ask users to sign up for your email newsletter with the option to only get updates for specific content categories.

    With email marketing services like Constant Contact or Brevo (formerly Sendinblue), you can easily set up an automated RSS-to-email newsletter for specific categories. You can see our guide on how to notify subscribers of new posts for step-by-step instructions.

    Similarly, you can also allow users to get instant push notifications for each category using PushEngage. It is the best push notification service on the market that allows you to send messages directly to your users’ devices (desktops as well as mobile phones).

    PushEngage allows you to set up automatic push notifications using RSS feeds. You simply need to enter your category RSS feed URL, and a push notification will go out whenever a new post is published in that category.

    We hope this article helped you learn how to make separate RSS feeds for each category in WordPress. You may also want to see our easy tips to grow your blog traffic or read our comparison of the best live chat software for small businesses.

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

    The post How to Make Separate RSS Feeds for Each Category in WordPress first appeared on WPBeginner.

    Go to source

  • How to Automatically Add a Disclaimer in WordPress (Easy Way)

    Do you want to automatically show disclaimers and important notices on your WordPress website?

    A disclaimer helps protect your business from legal action and provides users with additional information. Usually, you’d have to enter disclaimers in your content manually.

    In this article, we will show you how to automatically add a disclaimer in WordPress using an easy method.

    Automatically add a disclaimer in WordPress

    Why Show a Disclaimer in WordPress?

    Adding a disclaimer to your WordPress website is a great way of communicating important notices and announcements to your visitors. It also protects your business from being legally liable for any claims a user makes.

    There are many situations where you can show a disclaim on your website. For example, let’s say your site features product endorsements or has affiliate links. You can display an FTC disclosure stating how you may receive compensation from the companies whose products you feature on your website.

    Similarly, if you operate in an industry that is governed by different regulations, then you can show legal disclaimers. This is really helpful if you’re offering medical or health advice, legal advice, or financial investment tips.

    Let’s say you’re writing a blog post on General Data Protection Regulation (GDPR). You can show a disclaimer notifying users that they should get in touch with an internet law attorney to seek legal advice.

    Legal disclosure example

    On the other hand, if you have a WordPress blog where you share personal opinions, then adding a disclosure can safeguard you from any legal action.

    That said, let’s look at how you can automatically add a disclaimer in WordPress. You can click the links below to jump to any sections of this post.

    Creating Disclaimers in WordPress

    You can add disclosures manually in WordPress using the content editor. Simply enter the disclaimer content in your blog posts or page. However, this is time-consuming since WordPress doesn’t offer an option to show these disclaimers automatically, and you’d have to edit every page.

    An easy way to do that is by using WPCode. It is the best WordPress code snippet plugin that makes it very easy to manage and add custom code snippets.

    What’s a Code Blocks Snippet?

    WPCode offers a Custom Blocks Snippets feature that you can use to create disclaimers. What it does is it creates a custom WordPress block that you can automatically place anywhere on your site.

    Usually, this would require editing code or building a reusable block. WPCode makes the process easier, and you don’t have to mess around with the website code or have to manually edit posts and pages.

    Aside from creating disclaimers, you can also use this WPCode feature to make custom WordPress blocks for call-to-action boxes, display important notices, create interactive blocks that include forms or image sliders, and much more.

    For this tutorial, we will be using the WPCode Pro version because it includes the Custom Blocks Snippets option. However, there is also WPCode free version you can use to get started.

    First, you’ll need to install and activate the WPCode Pro plugin. If you need help, then please see our guide on how to install a WordPress plugin.

    Upon activation, you can head to Code Snippets » Settings from the WordPress admin panel and enter the license key. You’ll find the license key in your WPCode account area.

    Enter WPCode license key

    Next, you can go to Code Snippets » + Add Snippet from the WordPress dashboard.

    From here, you’ll need to select the ‘Add Your Custom Code (New Snippet)’ option.

    Choose the Custom Code option in the WPCode library to insert an ad

    After that, you can enter a name for your snippet, like ‘Disclaimer Notice.’

    Next, you must click the Code Type dropdown menu and select the ‘Blocks Snippet’ option. When you’re done, simply click the ‘Save Snippet’ button.

    Select blocks snippets and save

    You can now edit your disclaimer notice using the WordPress content editor.

    To do that, go ahead and click the ‘Edit with Block Editor’ button.

    Next, you’ll be taken to the block editor in WordPress. Go ahead and enter the text for your disclaimer.

    Enter the text for your disclaimer

    You can further customize your disclaimer notice using the styling options in the block editor.

    Simply switch to the ‘Style’ tab in the Settings panel on the right. From here, you can change the color of the text, background, and link. There are also options to edit the size of the text.

    For this tutorial, we will add a background color for the disclaimer notice so that it stands out from the rest of the text. Don’t forget to click the ‘Update’ button.

    Customize your disclaimer notice

    After customizing your disclaimer notice, you can then click the ‘Return to WPCode Snippet’ button at the top.

    Automatically Adding Disclaimers in WordPress

    Once you’re on the WPCode Snippet screen, simply scroll down to the ‘Insertion’ section. Here, you can select when and where your disclaimer notice will appear.

    You can keep the ‘Insert Method’ to Auto Insert. After that, go ahead and click the Location dropdown menu.

    Select insertion method for code snippet

    WPCode will now show multiple options. Go ahead and switch to the Page-Specific tab.

    Next, you can choose where your site will display the disclaimer. For example, it can appear at the beginning of a post, after a few paragraphs, at the end of the post, and more.

    For the sake of this tutorial, we will select the ‘Insert After Paragraph’ option. This way, the snippet will appear on all the pages after a certain number of paragraphs.

    Select location for code snippet

    WPCode will also let you select the number of paragraphs, after which the custom block snippet will appear.

    For example, we want the disclaimer notice to automatically appear after the first 3 paragraphs on all the pages on our demo site.

    Update and activate the snippet

    Once you’re done, don’t forget to activate the blocks snippet and click the ‘Update’ button at the top.

    Besides that, you can also insert the disclaimer notice on specific pages using shortcodes.

    Simply switch to the Insert Method from Auto Insert to Shortcode.

    Use shortcode to add blocks snippet

    After that, you can copy the shortcode and add it anywhere on your website. For example, you can show the disclaimer on specific pages and posts.

    WPCode also lets you schedule your disclaimer scripts. This is really useful if you have a time-sensitive notice to display on your website. You can simply select the start date and end date for scheduling the snippet.

    Schedule your snippet

    When you’re done, don’t forget to activate the snippet and click the ‘Update’ button.

    You can now visit your website to see the disclaimer in action.

    View disclaimer notice preview

    We hope this article helped you learn about how to automatically add a disclaimer in WordPress. You may also want to see our list of must-have WordPress plugins and tools for business sites and how to create an email newsletter the right way.

    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 Automatically Add a Disclaimer in WordPress (Easy Way) first appeared on WPBeginner.

    Go to source

  • How to Use Shortcodes in your WordPress Sidebar Widgets

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

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

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

    How to use shortcodes in your WordPress sidebar widgets

    Why Use Shortcodes in Your WordPress Sidebar Widgets?

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

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

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

    An example of a social media sidebar widget

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

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

    Method 1: Using the WordPress Shortcode Widget (Easy)

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

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

    Adding a shortcode widget to a WordPress sidebar

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

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

    How to add a shortcode to the WordPress sidebar

    You can now add your shortcode to the block.

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

    Publishing a shortcode block in WordPress

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

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

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

    Opening the WordPress full-site editor (FSE)

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

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

    Choosing a block-based FSE template

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

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

    A block-based WordPress theme

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

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

    Adding a WordPress block to the sidebar

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

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

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

    An example of a giveaway created using RafflePress

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

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

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

    That’s where WPCode comes in.

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

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

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

    Adding a code snippet to your WordPress website

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

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

    Adding shortcode to a custom HTML block using code

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

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

    Adding shortcode to a sidebar widget using code

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

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

    Adding a Custom HTML widget to a WordPress sidebar

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

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

    Adding a custom HTML widget to a WordPress website

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

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

    FAQ: Using Shortcodes in WordPress Sidebar Widgets

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

    How Do I Change Where the Sidebar Widget Appears?

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

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

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

    Changing your theme's sidebar settings

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

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

    The Astra sidebar settings

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

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

    How Do I Add a Sidebar to My WordPress Theme?

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

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

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

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

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

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

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

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

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

    Go to source

  • How to Sell Your Website or Online Business (Complete Guide)

    Are you looking to sell your website or online business?

    Selling a business or website is like selling a house. It can be stressful and involves a lot of preparation and paperwork. Many beginners are unsure how to get started.

    In this article, we’ll show you how to sell your website or online business for the highest price.

    How to Sell Your Website or Online Business

    Why Sell Your Website or Online Business?

    So you’ve taken time to create a successful website and build an online business around it.

    But what do you do when it’s time to move on to something new?

    Perhaps your circumstances have changed or you want to take time off to travel. Maybe you simply need the money or you are ready for a new business adventure.

    What is the best way to sell your website or online business and get what it’s worth? For that matter, how do you find out how much your site is worth to begin with?

    Selling a website can be overwhelming. However, it’s certainly possible to sell your site for what it’s worth. In fact, many people make money online by flipping websites.

    With that being said, let’s take a look at how to sell your website or online business for what it’s worth. Here are the topics we’ll cover:

    How Much Is Your Website Worth?

    You might be wondering how much you can realistically sell your website for. It’s impossible to come up with an exact figure, but we’ll show you how to come up with a workable range.

    One rule of thumb is that you can generally sell a website for 2 to 3 times your annual profit, after expenses. This will mean that the person buying your website can expect to make their money back in just two to three years.

    This gives you a ballpark range to start with. However, in some cases, you can make even more money. For example, subscription-based websites and businesses that serve a particular niche such as health or personal finance are often worth more.

    You can get a better estimate of your site’s value using online website value calculators.

    The Flippa Free Online Business Valuation Tool gives you a figure for how much your website is worth after answering six questions. This should only take a few minutes to complete.

    Flippa Free Online Website Evaluation Tool

    The Empire Flippers Valuation Tool also calculates a valuation for your website after answering a few questions.

    However, to receive the valuation you will first need to provide your email address and optionally your phone number.

    Empire Flippers Valuation Tool

    There are other tools that give you a rough valuation based on just your website’s URL. Potential buyers may use them to get an idea of how much your site is worth, so you may want to check them as well.

    Finally, you can have a look at what websites similar to yours are selling for. The best way to do this is by searching on the Flippa website and checking the ‘Recently Sold’ box at the bottom of the left column.

    You might also like to talk to a website broker since they are experienced in valuing and selling websites. More on that later.

    How to Make Your Website More Valuable

    If you’re not in a hurry to sell your site, then you will be able to make more money by waiting until it peaks. This means that you need to do some work first, and the more effort you put in, the easier it will be to sell.

    In particular, you should focus on maximizing your traffic and profits before you sell. This will increase the value of your site and business. Most buyers will carefully look at your last year of sales, so you need to make the numbers as good as you can.

    Increase Traffic to Your Website

    The more visitors your website has, the more valuable it will be.

    Since most of your organic traffic will come from search engines, you need to improve your search engine optimization (SEO) so your site ranks higher on Google.

    You can get started by working through our 13-point WordPress SEO checklist for beginners.

    Improve Your Website’s Performance

    A fast website is more valuable than a slow one. Fast-loading pages improve user experience, increase your pageviews, and help with your WordPress SEO.

    Our ultimate guide to boosting WordPress speed and performance is full of actionable steps that you can take to improve your WordPress speed immediately.

    For online stores, you can follow our guide on how to speed up WooCommerce performance.

    Grow Your Social Media Followers

    Potential buyers will also be interested in your reach on social media. You can start to build your social following using our complete social media cheat sheet.

    Create an Email List

    In our business, an email list gets 10 times higher conversions than social media campaigns.

    Building an email list will increase conversions and grow your profits, and will be a valuable resource to the person buying your business.

    See our guide on the right way to create an email newsletter to learn how to get started.

    Improve Your Profits

    You can also start looking for new ways to make money and improve profits. The profits you made over the last year is an important indicator of the value of your website.

    If you have a blog, then you’ll find plenty of ways to increase your profits in our guide on proven ways to make money online blogging with WordPress.

    If you have an online store, then you can start tracking your WooCommerce conversions with MonsterInsights to learn what is working and what needs more attention.

    Launch setup wizard

    How to Make Sure Your Business Is Transferrable

    Once your website is sold, how easy will it be to transfer to the new owners? Potential buyers will want to know that the website will continue running successfully after the sale.

    Now is the time to start preparing everyone for a change in ownership and removing potential obstacles to a smooth transition.

    Make Sure Your Business Does Not Rely on You Personally

    Make sure your website or business will continue to run smoothly once you are no longer involved. Most buyers are looking for an investment, not a full-time job trying to replace you.

    That means you will need to train a team or virtual assistant to run the business, including customer support, operations, and more.

    For example, if you sell WordPress plugins, then make sure that your team includes developers who understand the software and can continue to maintain it after the sale.

    You can also use automation and artificial intelligence to ensure that your website or online store runs smoothly with minimal effort.

    Alternatively, you can switch to managed WordPress hosting where backups, updates, and many other maintenance tasks are done for you.

    Prepare Any Third Parties for the Change of Ownership

    If your business relies on third-party businesses, then you need to make sure those relationships will continue after the change. This can include your partners, suppliers, influencers, freelancers, and more.

    For example, if you are getting a special deal from one of your suppliers that helps you stay profitable, then you should make sure the deal will carry on with the new owners.

    Make Sure the Necessary Resources Are Transferrable

    If you run several websites or businesses, then you may be sharing resources between them, such as a phone number, customer support staff, or your website hosting account.

    If that’s the case, then you will need to separate them before you can sell. This will allow you to transfer each of these resources to the new owner more easily.

    Make sure that you handle your communications in a business email account you can transfer to the new owner rather than your personal email account.

    And check that any premium WordPress plugins your site relies on are registered in the name of the business and use a business email address.

    Also, you should make sure that any team management tools you are using can be transferred to the new owner. For example, Slack makes it easy to transfer ownership.

    Create Standard Operating Procedures

    If you haven’t already done so, consider creating standard operating procedures on how you run your business and handle specific tasks. This will help the new owners continue to run it with the same success you have.

    This could include how you do keyword research, create content, optimize for search engines, create product catalogs, and more.

    Final Preparations Before the Sale

    Once you put your website up for sale, potential buyers are going to be doing their due diligence to weigh up whether your business is worth buying. They will ask you a lot of detailed questions.

    This means you will need to collect accurate data about your website and finances.

    Collect Accurate Website Metrics

    Potential buyers will want to see detailed reports about your website. Hopefully, you have already been keeping information about your traffic, visitors, conversion rates, and more.

    If not, you can follow our guide on tracking important website metrics such as site speed, traffic, top referrals and countries, demographics, and your best-performing posts and pages.

    We recommend you document at least three to six months of the following:

    Collect Accurate Financial Records

    You should also get your financial records up to date. Messy finances are frustrating to buyers and force them to do more work in making their decision.

    Here are some financial reports potential buyers would like to see:

    • Profit and Loss sheet
    • Proof of Sales (if you have an online store)
    • PPC ad spend

    You may find it worth hiring an accountant. They understand what they are doing, and can get your records into a form that’s easy for potential buyers to understand.

    Alternatively, websites like Flippa offer due diligence verification and assessment services.

    Place a Dollar Value on Your Business Assets

    Make sure that you place a value on all of the assets that you will be selling along with your business. These increase the value of your business.

    This can include your working capital, store inventory, team, and Adwords campaign history.

    You can also try to put a price on less tangible assets like your customer database, email list, social media engagement, website traffic, and processes and procedures.

    Where Can You Sell Your Website or Online Business Safely?

    Once you are ready, you need to choose the right place to sell your website. Typically, this will be with an online marketplace or a broker.

    Flippa

    Flippa

    Flippa is the best online marketplace to sell your site. It’s an auction site similar to eBay but specializes in online businesses, websites, and domain names.

    They maintain a list of affiliated reputable business brokers who can help you with the sale.

    Users can follow auctions and bid on your website or business. If you accept their bid, then they follow the Flippa payment guidelines.

    Usually, sellers use Flippa’s escrow service for secure payments and transfer of registration.

    Empire Flippers

    Empire Flippers

    Empire Flippers is a leading broker that will help sell your business or online business. They will value your business, design the sales page, and handle the advertising.

    A broker is a great choice if you’re not sure where to start, or you’re just short of time. And because they charge a commission, they are motivated to get the best price that they can.

    Whether you choose a marketplace or broker, they will give you all the help you need when it comes time to transfer the website or business to the new owner.

    We hope this tutorial helped you learn how to sell your website or online business. You may also want to see our guide on creating a WordPress membership site, or our expert picks on the best drag and drop WordPress page builders.

    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 Sell Your Website or Online Business (Complete Guide) first appeared on WPBeginner.

    Go to source

  • Can ChatGPT Build a Useful WordPress Plugin That Actually Works?

    Can AI turn non-coders into pro WordPress plugin developers? To find out, we asked ChatGPT to build a custom WordPress plugin from scratch and then had our crack team of developers examine the code…

    AI is the world’s most popular two-letter word right now. With all the recent news headlines about whether AI will take our jobs away, we wanted to know… can ChatGPT actually develop a functional and useful WordPress plugin without having to write code from scratch? And does the plugin meet best coding practices?

    Fortunately, WPMU DEV builds some of the most robust WordPress plugins in the world, so we have plenty of expert WordPress plugin developers who can put ChatGPT to the test.

    In fact, if you take a stroll around our company’s virtual corridors, you can’t help but bump into WordPress coders and developers. It seems everyone around here can look at a WordPress plugin and see PHP the way Neo sees the Matrix’s digital rain code.

    Everyone, that is …except me!

    I’m just a blog writer with no coding skills and a burning desire to add “prompt engineer” to my resumé.

    So, in this post, we’ll explore how to leverage the power of ChatGPT to build a simple custom WordPress plugin quickly and securely, even if you lack extensive coding skills.

    We’ll do this by:

    1) Asking ChatGPT to generate the code for a useful plugin that we can test, and

    2) Running the code generated by ChatGPT past our team of professional plugin developers so they can review it and provide their honest feedback.

    We’ll cover the following:

    Exploring the Power of ChatGPT for WordPress Plugin Development

    One of the reasons WordPress is the world’s most popular content management system is the software’s flexibility and extensibility to create sites that can do anything and everything using plugins.

    While there are over 60,000 free WordPress plugins available covering every type of functionality you can imagine, sometimes you may need a custom solution to meet a client’s specific requirements.

    If you’re not a WordPress plugin developer, then until recently, your only options were to either become a WordPress plugin developer and learn how to code a plugin from scratch or modify an existing plugin’s code, or hire a WordPress developer to do this for you.

    With the explosion of new AI tools and technologies, we now have a third option, which while not necessarily promising to do things better, can help you get things done cheaper and faster (check out our recent article on ways that ChatGPT can help you as a WordPress developer).

    ChatGPT, powered by OpenAI, is an advanced language model capable of generating human-like text based on given prompts. It also claims to be able to assist you in the process of building custom WordPress plugins by providing code snippets, explanations, and even recommendations for best practices.

    So, we wanted to find out for ourselves if we can leverage ChatGPT to accelerate the WordPress plugin development process and ensure the security of your plugins.

    To do this, we’ll ask ChatGPT to build us a simple, useful, and functional plugin.

    Define Your Plugin’s Functionality

    Before using ChatGPT to generate code, you need to have a clear understanding of the functionality you want your plugin to provide.

    This starts by outlining the specific features, actions, or modifications you want to achieve with your plugin. This will then help you generate accurate prompts for ChatGPT and ensure that your AI-generated code aligns with your desired outcomes.

    Generate Code Snippets with ChatGPT

    To generate our code snippets using ChatGPT, we’ll keep things simple (and free) and use the freely available interface provided by OpenAI.

    Take #1…

    Note: My first attempt at using ChatGPT to create a WordPress plugin from scratch was way too ambitious. I asked ChatGPT to build me a simple WordPress time-travel dummy text generating plugin, using the prompt below…

    ChatGPT - WordPress plugin creation prompt.
    This prompt will surely kick ChatGPT’s WordPress plugin development tyres.

    As someone who spends a lot of time writing WordPress tutorials, I often need dummy content to test plugins, create screenshots, etc.

    So, I thought it would be great to model my AI-generated dummy content plugin on a plugin I often use called FakerPress.

    ChatGPT immediately pushed back on my request and told me that creating a fully functional WordPress plugin with all the features I described was beyond the scope of a single response.

    However, it did offer to provide me with a basic template, guide me on how to implement some of the features I mentioned, and even gave me instructions on how to create a plugin directory and file…

    ChatGPT response to WordPress plugin development prompt.
    Mmm…maybe my first attempt at creating a WordPress plugin was a tad too ambitious!

    At first, I thought there was light at the end of the tunnel. ChatGPT output code that looked quite impressive to my untrained eyes and unskilled mind…

    ChatGPT code
    To someone who knows ‘zip’ about coding, the above code snippet sure looks impressive!

    ChatGPT also output all the additional code required to complete the next steps.

    ChatGPT - WordPress plugin development prompt.
    Lacking coding skills, I relied on ChatGPT to guide me through each step of the plugin development process.

    And it apologized for my lack of coding knowledge and experience…

    ChatGPT- prompt
    This is what happens when a dummy asks ChatGPT to create a dummy plugin.

    It also guided me with step-by-step instructions, just like it had promised…

    Screenshot of ChatGPT response.
    I’m just gonna let ChatGPT do all the heavy lifting here…

    I can’t really describe what I felt seeing ChatGPT spit out the code, but it’s probably similar to what Bill Gates must have felt when he first held a set of floppy disks containing the working code for the Windows operating system.

    Set Up Your Test Site

    With the plugin code generated, the next step was to set up a dummy site to test the plugin.

    I quickly spun a new site in The Hub.

    The Hub - Create A New Site
    Let’s spin up a new test site using The Hub.

    Note: If you are developing a plugin for an existing site, we recommend setting up a local development environment or a staging site to ensure that the plugin works as intended and does not conflict with other existing plugins or themes on the site.

    After drumming my fingers on my desk for a few minutes, my new WordPress site was ready.

    New WordPress site.
    A brand new WordPress site with not much to see just yet.

    With the test site set up, the next step was to upload the plugin and test to make sure it works.

    Test Your Custom Plugin

    I followed ChatGPT’s instructions and uploaded the plugin folder to the wp-content > plugins directory of my test site using The Hub’s file manager.

    The Hub - File Manager
    I could have used the Plugin uploader, but The Hub’s File Manager works just as well!

    With the plugin file uploaded, I activated it inside the Plugins screen.

    Plugins screen - Dummy Content Generator activation menu link.
    And now for the moment we’ve all been waiting for [drumroll]…
    And…I got a fatal error!

    Plugins screen - Fatal error message.
    What an anticlimax…the lowest point of my WordPress plugin development career!

    Assuming that maybe I didn’t add the additional snippets that ChatGPT provided correctly, I went back and asked for all the code to be provided as a single file that I could simply copy and paste to overwrite and update the uploaded plugin file.

    ChatGPT obliged and delivered me the complete code.

    Screenshot of ChatGPT prompt and response.
    Why couldn’t it just have given me the entire copy and paste code the first time?

    There was a lot of code to output, so every time things came to a standstill, I instructed ChatGPT to continue the process.

    Screenshot of ChatGPT prompt and response.
    ChatGPT sometimes just needs a little gentle encouragement to keep going.

    I repeated this process several times.

    Screenshot of ChatGPT response.
    Feels like ChatGPT and I are like an old married couple now…

    Finally, the entire code was output. ChatGPT even provided some helpful information at the end of the process.

    Screenshot of ChatGPT response.
    After waiting a whole 2 minutes…ChatGPT finally output all of the plugin code!

    I uploaded the plugin file with the new code to my test site, then jumped into the site’s admin area and activated the plugin.

    It worked! Or so it seemed.

    ChatGPT even gave the plugin its own menu item…

    Dummy Content Generator WordPress plugin -created by ChatGPT
    ChatGPT created all this!

    And a settings screen with lots of fancy boxes and fields.

    Dummy Content Generator WordPress plugin settings screen.
    Looks impressive…but will it work?

    My first impression was “Wow…ChatGPT created the plugin and made its own decisions about some of the plugin settings and the user interface layout and design!”

    But… “does the plugin work?”

    I couldn’t see a field where I could specify how many posts or pages to create, so I simply ticked some boxes, entered some values, and clicked on the “Save Changes” button to see what happens.

    Dummy Content Generator WordPress plugin -created by ChatGPT
    And now, for the moment of truth…

    And…absolutely nothing happened!

    WordPress Posts Table showing a sinlge "Hello world" post.
    The newest lowest point of my WordPress plugin development career…a plugin that does nothing!

    My fancy-ass plugin was all make-believe, just like one of those children’s playground spaceships that’s filled with useless knobs you can turn and buttons you can press while pretending to be flying in outer space.

    So, I reached out to one of our developers via Slack and asked them to look at the plugin file.

    Some of the comments that came back included the following:

    • “The plugin tries to generate random content on each and every admin page load”
    • “It calls a function dummy_content_generator_generate_content_paragraphs which, in turn, attempts to call dummy_content_generator_get_random_paragraph for every paragraph it tries to generate. The problem is that there is no dummy_content_generator_get_random_paragraph function.
    • “The page loads to a point, then it errors out because there’s more missing stuff”
    • “Other than all the mentioned issues, there’s no validation whatsoever, and no escaping of the output, which is terrible”
    • “In terms of having something as starting point, this is a very, very poor one. In terms of having a working plugin, this is nowhere near that”

    After some back and forth discussions , it was deemed that there was quite a lot wrong with the plugin, that it would take a lot of work to fix it, and they suggested I scrap the project.

    At this point, however, I was too invested in my mission to simply abandon everything and give up. Recalling Sir Winston Churchill’s famous words (“Fetch me another brandy” “Never give in, never give in, never, never, never…”), I decided it was time for…

    Take #2…

    Ok, so my first attempt to get ChatGPT to build a WordPress plugin from scratch was a dismal failure. This in itself provided some valuable insights into ChatGPT’s ability to perform complex coding tasks (or, as someone in the team put it, “you can’t code using ChatGPT without having extensive coding knowledge.”)

    So, for “Take #2,” let’s reset and go again with a simpler plugin request.

    Going back to the drawing board, a genius lightbulb moment lit up my mind…why not ask ChatGPT to suggest ideas for simple WordPress plugins it could then generate the code for?

    So, that’s what I did. Here’s the prompt I promptly engineered…

    ChatGPT prompt for generating WordPress plugin ideas.
    My genius prompt.

    And here’s the list of suggested plugins ChatGPT replied with…

    ChatGPT - List of WordPress plugin ideas.
    The blueprint of my WordPress plugin empire.

    I liked the last suggestion, so I asked ChatGPT to generate the code for a functional content duplicator plugin, and it immediately went to work.

    ChatGPT prompt to generate code for a WordPress plugin that duplicates content.
    This is what a license to print money looks like!

    ChatGPT generated the following code for the plugin in the blink of an eye:

    
    <?php
    /*
    Plugin Name: Content Duplicator
    Description: Allows users to duplicate posts, pages, or custom post types with one click.
    Version: 1.0.0
    Author: Your Name
    Author URI: https://yourwebsite.com
    */
    
    // Add duplicate action links to post row actions
    function content_duplicator_add_duplicate_link( $actions, $post ) {
        if ( current_user_can( 'edit_posts' ) ) {
            $actions['duplicate'] = '<a href="' . wp_nonce_url( admin_url( 'admin-post.php?action=content_duplicator_duplicate_post&post_id=' . $post->ID ), 'content_duplicator_duplicate_post' ) . '" title="Duplicate this item" rel="permalink">Duplicate</a>';
        }
        return $actions;
    }
    add_filter( 'post_row_actions', 'content_duplicator_add_duplicate_link', 10, 2 );
    
    // Duplicate the post
    function content_duplicator_duplicate_post() {
        if ( isset( $_GET['post_id'] ) ) {
            $post_id = absint( $_GET['post_id'] );
    
            if ( current_user_can( 'edit_posts' ) && wp_verify_nonce( $_GET['_wpnonce'], 'content_duplicator_duplicate_post' ) ) {
                $post = get_post( $post_id );
    
                $args = array(
                    'post_title' => $post->post_title . ' (Duplicate)',
                    'post_content' => $post->post_content,
                    'post_type' => $post->post_type,
                    'post_status' => $post->post_status,
                    'post_parent' => $post->post_parent,
                    'post_author' => get_current_user_id(),
                );
    
                $new_post_id = wp_insert_post( $args );
    
                if ( $new_post_id ) {
                    // Duplicate meta fields
                    $meta_fields = get_post_custom( $post_id );
                    foreach ( $meta_fields as $key => $values ) {
                        foreach ( $values as $value ) {
                            add_post_meta( $new_post_id, $key, $value );
                        }
                    }
    
                    // Redirect to the duplicated post
                    wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );
                    exit;
                }
            }
        }
    }
    add_action( 'admin_post_content_duplicator_duplicate_post', 'content_duplicator_duplicate_post' );
    
    

    It even provided a set of instructions after generating the code.

    ChatGPT instructions.
    The code not only comes with instructions, but ChatGPT even says “Please”!

    I then went back to my test site and uploaded the new plugin file to the wp-content > plugins directory.

    The Hub - File Manager
    There’s a lot of action to unpack in this screenshot.

    I also created a dummy post to test the plugin with…

    WordPress test post.
    Can the plugin duplicate this cheesy post? Let’s find out!

    Here are the post’s menu options before activating the plugin…

    WordPress Posts table with single post entry.
    A default post with default options.

    Let’s go and activate the plugin…

    WordPress Plugins screen - Activate Content Duplicator
    “Activate Content Duplicator” – Sounds like a line from a Star Trek movie.

    Success! The plugin activated.

    WordPress Plugins screen - Plugin activated message.
    A gratuitous screenshot proving that the plugin successfully activated.

    Now, let’s see if the plugin actually works.

    Here’s my test post again. Note that the plugin has added a new “Duplicate” item to the menu after being activated.

    Let’s click on “Duplicate” and see what happens…

    WordPress Posts Table - Post entry with a new Duplicate item.
    ChatGPT even added a “Duplicate” menu item tooltip to the code!

    A duplicate post has been created…

    An example of a duplicated WordPress post.
    A duplicate of the original post.

    Here’s the table of posts showing entries for the original and duplicated post.

    WordPress Posts table with original post and duplicated post.
    The original post and its cloned version.

    I’m sure that with better prompt engineering and some code tweaking, the plugin could have been significantly improved. For example, I would prefer if the plugin set the post status of the newly-duplicated post to ‘draft’ instead of publishing it, but ChatGPT delivered a simple WordPress plugin that worked. It was basic, but it did the job.

    All I needed to do now was to ask someone who codes WordPress plugins for a living to scrutinize the code and share how they felt about using a tool like ChatGPT to code plugins.

    Feedback from Our Expert Plugin Developers

    Shortly after uploading the plugin to one of our testing channels, I got pinged from one of our developers. Here are some of the key points provided in their feedback:

    • “ChatGPT et al are decent at answering questions you already know the answer to.”
    • “I also used it in the past to build a simple plugin for me, but as long as I was giving more complex prompts, it started to mess things around, so eventually I manually debug the given code to work, cause else it’d take ages for it to actually debug it line by line.”
    • “Basically, it does what it says. However, it does what it says very literally. As in, it will duplicate a post and its corresponding postmeta (custom) fields. However, it doesn’t seem like it will propagate any taxonomies to the duplicated post (the plugin should copy and assign the same taxonomy terms, such as categories or tags, from the original post to the duplicated post).”
    • If I was to be super-nitpicky about this, I’d also mention that it’s not L10n-ready – there won’t be an option to translate this plugin. But, that’s just being very nitpicky – I don’t really think, nor would I expect, a prompt-generated plugin to be generic enough to be needing something like that at all. To me, it is more of a “very specific problem domain” kind of a thing, including the language used. At the end of the day, it does do what it says it will, which is very nice.”

    In addition to examining the WordPress plugin code generated by ChatGPT and providing feedback as shown above, our developers also agreed with the following key points after assessing ChatGPT’s current capabilities to generate code:

    1 – It’s important to exercise caution and not blindly accept ChatGPT-generated code as correct.

    • ChatGPT can provide answers, but it’s up to the user to assess whether the answer is correct or not.
    • There is a risk of receiving incorrect or nonsensical answers from ChatGPT, both obvious and subtle.
    • It’s important to exercise caution and not blindly accept the generated code as correct.
    • ChatGPT’s output should be treated as autocomplete, making life easier but requiring caution and verification.

    The ability to discern good code from bad or nonsensical code, however, implies that…

    2 – Users should have sufficient knowledge and understanding of WordPress plugin development to evaluate and modify the generated code as needed.

    • ChatGPT can help simplify and expedite the process of building simple custom WordPress plugins, generate code snippets, and provide explanations. Anything more complex, however, requires plugin development experience and coding skills.
    • Using ChatGPT without sufficient knowledge can lead to negative consequences or unreliable code.
    • Relying solely on ChatGPT without critical thinking is similar to blindly copying the first answer from Stack Overflow (Stack Overflow threads provide more context, multiple answers, and feedback from other users, making it a more reliable resource, but Stack Overflow threads tend to be more generic, whereas ChatGPT can provide specific answers to individual queries).

    3 – Utilizing other resources, such as WordPress documentation, tutorials, and community forums, alongside ChatGPT can provide a more comprehensive understanding of WordPress plugin development.

    • As you explore the possibilities of using ChatGPT for WordPress plugin development, it’s valuable to engage with the WordPress community. Share your experiences, ask for feedback, and seek guidance from experienced developers. Participating in forums, attending WordPress meetups, or joining online communities can provide valuable insights and help you refine your plugin development process.
    • Additionally, consider following WordPress security best practices to safeguard your website from potential vulnerabilities. ChatGPT can provide recommendations on security measures you can implement to protect your plugin.
    • It’s also essential to maintain a clear understanding of your desired functionality and thoroughly review and test the generated code and secure your custom plugins before deploying them to a production environment.

    Can ChatGPT Turn You Into a WordPress Plugin Developer?

    We’ve explored how you can utilize ChatGPT to build simple custom WordPress plugins quickly and securely, even if you have limited coding experience.

    Beyond the core functionality of your plugin, you can also leverage ChatGPT to generate code for custom user interfaces. With its ability to understand prompts and generate HTML, CSS, and JavaScript snippets, you can create intuitive admin interfaces, front-end components, and interactive elements that will enhance the user experience and allow you to deliver a polished final product.

    By utilizing the language model’s capabilities, you can generate code snippets, optimize functionality, and create user-friendly interfaces. However, it’s crucial to understand the generated code, review and refine it, and thoroughly test your custom plugins before deploying them to your live website.

    The generated code may also require adjustments to align with coding standards, naming conventions, or specific project requirements. This requires a certain amount of coding knowledge and skills, as does optimizing the code and ensuring it follows WordPress coding guidelines for better maintainability.

    The bottom line: AI-powered tools like ChatGP can streamline your workflow, boost productivity, and unlock new possibilities. While ChatGPT is a powerful and valuable tool to have in your arsenal, AI won’t replace skilled coders any time soon.

    Interested in Developing WordPress plugins?

    Check out some of our tutorials and articles on WordPress plugin development:

    Go to source

  • Can ChatGPT Build a Useful WordPress Plugin That Actually Works?

    Can AI turn non-coders into pro WordPress plugin developers? To find out, we asked ChatGPT to build a custom WordPress plugin from scratch and then had our crack team of developers examine the code…

    AI is the world’s most popular two-letter word right now. With all the recent news headlines about whether AI will take our jobs away, we wanted to know… can ChatGPT actually develop a functional and useful WordPress plugin without having to write code from scratch? And does the plugin meet best coding practices?

    Fortunately, WPMU DEV builds some of the most robust WordPress plugins in the world, so we have plenty of expert WordPress plugin developers who can put ChatGPT to the test.

    In fact, if you take a stroll around our company’s virtual corridors, you can’t help but bump into WordPress coders and developers. It seems everyone around here can look at a WordPress plugin and see PHP the way Neo sees the Matrix’s digital rain code.

    Matrix code
    What PHP code looks like to experienced WordPress plugin developers. Source: Giphy.com

    Everyone, that is …except me!

    I’m just a blog writer with no coding skills and a burning desire to add “prompt engineer” to my CV.

    So, in this post, we’ll explore how to leverage the power of ChatGPT to build a simple custom WordPress plugin quickly and securely, even if you lack extensive coding skills.

    We’ll do this by:

    1) Asking ChatGPT to generate the code for a useful plugin that we can test, and

    2) Running the code generated by ChatGPT past our team of professional plugin developers so they can review it and provide their honest feedback.

    We’ll cover the following:

    Step 1 – Define the Plugin’s Functionality

    Before using ChatGPT to generate code, we need to have a clear understanding of the functionality we want our plugin to provide.

    This starts by outlining the specific features, actions, or modifications we’ll want to achieve with our plugin. This will then help us generate accurate prompts for ChatGPT and ensure that our AI-generated code aligns with our desired outcomes.

    Step 2 – Generate Code Snippets with ChatGPT

    To generate our code snippets using ChatGPT, we’ll keep things simple (and free) and use the freely available interface provided by OpenAI.

    Take #1…

    Note: My first attempt at using ChatGPT to create a WordPress plugin from scratch was way too ambitious. I asked ChatGPT to build me a simple WordPress time-travel dummy text generating plugin, using the prompt below…

    ChatGPT - WordPress plugin creation prompt.
    This prompt will surely kick ChatGPT’s WordPress plugin development tyres.

    As someone who spends a lot of time writing WordPress tutorials, I often need dummy content to test plugins, create screenshots, etc.

    So, I thought it would be great to model my AI-generated dummy content plugin on a plugin I often use called FakerPress.

    ChatGPT pushed back on my request and let me know that creating a fully functional WordPress plugin with all the features I requested was beyond the scope of a single response.

    However, it did offer to provide me with a basic template, guide me on how to implement some of the features I mentioned, and even gave me instructions on how to create a plugin directory and file…

    ChatGPT response to WordPress plugin development prompt.
    Mmm…maybe my first attempt at creating a WordPress plugin was too ambitious!

    At first, ChatGPT output code that looked quite impressive…

    ChatGPT code
    To someone who knows ‘zip’ about coding, the above code snippet sure looks impressive!

    ChatGPT also output all the additional code required to complete the next steps.

    ChatGPT - WordPress plugin development prompt.
    Lacking coding skills, I relied on ChatGPT to guide me through each step of the plugin development process.

    With the plugin code output, the next step was to upload the plugin to my test site and test it to make sure it works.

    Step 3 – Test The Custom Plugin

    After uploading the folder containing the plugin code to the wp-content > plugins directory of my test site and activating it inside the Plugins screen…

    Plugins screen - Dummy Content Generator activation menu link.
    And now for the moment we’ve all been waiting for [drumroll]…
    I got a fatal error!

    Plugins screen - Fatal error message.
    What an anticlimax…the lowest point of my WordPress plugin development career!

    Assuming that maybe I didn’t add the additional snippets that ChatGPT provided correctly, I went back and asked for all the code to be provided as a single file that I could simply copy and paste to overwrite and update the uploaded plugin file…

    Screenshot of ChatGPT prompt and response.
    Why couldn’t it just have given me the entire copy and paste code the first time?

    There was a lot of code to output, so whenever the process came to a standstill, I instructed ChatGPT to continue…

    Screenshot of ChatGPT prompt and response.
    ChatGPT sometimes just needs a little gentle encouragement to keep going.

    After repeating this process several times, ChatGPT output the entire code and even provided some helpful information.

    Screenshot of ChatGPT response.
    After waiting a whole 2 minutes…ChatGPT finally output all of the plugin code!

    I uploaded the plugin file with the new code to my test site, then jumped into the site’s admin area and activated the plugin.

    It worked! Or, so it seemed.

    ChatGPT gave the plugin its own menu item…

    Dummy Content Generator WordPress plugin -created by ChatGPT
    ChatGPT created all this!

    And a settings screen with lots of fancy boxes and fields…

    Dummy Content Generator WordPress plugin settings screen.
    Looks impressive…but will it work?

    But I couldn’t see a field to specify how many posts or pages to create, so I simply ticked some boxes, entered some values, and clicked on the “Save Changes” button to see what happens.

    Dummy Content Generator WordPress plugin -created by ChatGPT
    And now, for the moment of truth…

    And…absolutely nothing happened!

    WordPress Posts Table showing a sinlge "Hello world" post.
    The newest lowest point of my WordPress plugin development career…a plugin that does nothing!

    My fancy-ass plugin was all make-believe, just like one of those children’s playground spaceships that’s filled with useless knobs you can turn and buttons you can press while pretending to be flying in outer space.

    So, I reached out to one of our developers via Slack and asked them to look at the plugin file.

    Some of the comments that came back included the following:

    • “The plugin tries to generate random content on each and every admin page load”
    • “It calls a function dummy_content_generator_generate_content_paragraphs which, in turn, attempts to call dummy_content_generator_get_random_paragraph for every paragraph it tries to generate. The problem is that there is no dummy_content_generator_get_random_paragraph function.
    • “The page loads to a point, then it errors out because there’s more missing stuff”
    • “Other than all the mentioned issues, there’s no validation whatsoever, and no escaping of the output, which is terrible”
    • “In terms of having something as starting point, this is a very, very poor one. In terms of having a working plugin, this is nowhere near that”

    After some back and forth discussions , it was deemed that there was quite a lot wrong with the plugin, that it would take a lot of work to fix it, and they suggested I scrap the project.

    At this point, however, I was too invested in my mission to simply abandon everything and give up. Recalling Sir Winston Churchill’s famous words (“Fetch me another brandy” “Never give in, never give in, never, never, never…”), I decided it was time for…

    Take #2…

    Ok, so my first attempt to get ChatGPT to build a WordPress plugin from scratch was a dismal failure. This in itself provided some valuable insights into ChatGPT’s ability to perform complex coding tasks (or, as someone in the team put it, “you can’t code using ChatGPT without having extensive coding knowledge.”)

    So, for “Take #2,” I decided to try again with a simpler plugin request.

    Going back to the drawing board, a genius lightbulb moment lit up in my mind…why not ask ChatGPT to suggest ideas for simple WordPress plugins it could then generate the code for?

    So, that’s what I did. Here’s the prompt I promptly engineered…

    ChatGPT prompt for generating WordPress plugin ideas.
    My genius prompt.

    And here’s the list of suggested plugins ChatGPT replied with…

    ChatGPT - List of WordPress plugin ideas.
    The blueprint of my WordPress plugin empire.

    I liked the last suggestion, so I asked ChatGPT to generate the code for a functional content duplicator plugin, and it immediately went to work.

    ChatGPT prompt to generate code for a WordPress plugin that duplicates content.
    This is what a license to print money looks like!

    ChatGPT generated the following code for the plugin in the blink of an eye:

    
    <?php
    /*
    Plugin Name: Content Duplicator
    Description: Allows users to duplicate posts, pages, or custom post types with one click.
    Version: 1.0.0
    Author: Your Name
    Author URI: https://yourwebsite.com
    */
    
    // Add duplicate action links to post row actions
    function content_duplicator_add_duplicate_link( $actions, $post ) {
        if ( current_user_can( 'edit_posts' ) ) {
            $actions['duplicate'] = '<a href="' . wp_nonce_url( admin_url( 'admin-post.php?action=content_duplicator_duplicate_post&post_id=' . $post->ID ), 'content_duplicator_duplicate_post' ) . '" title="Duplicate this item" rel="permalink">Duplicate</a>';
        }
        return $actions;
    }
    add_filter( 'post_row_actions', 'content_duplicator_add_duplicate_link', 10, 2 );
    
    // Duplicate the post
    function content_duplicator_duplicate_post() {
        if ( isset( $_GET['post_id'] ) ) {
            $post_id = absint( $_GET['post_id'] );
    
            if ( current_user_can( 'edit_posts' ) && wp_verify_nonce( $_GET['_wpnonce'], 'content_duplicator_duplicate_post' ) ) {
                $post = get_post( $post_id );
    
                $args = array(
                    'post_title' => $post->post_title . ' (Duplicate)',
                    'post_content' => $post->post_content,
                    'post_type' => $post->post_type,
                    'post_status' => $post->post_status,
                    'post_parent' => $post->post_parent,
                    'post_author' => get_current_user_id(),
                );
    
                $new_post_id = wp_insert_post( $args );
    
                if ( $new_post_id ) {
                    // Duplicate meta fields
                    $meta_fields = get_post_custom( $post_id );
                    foreach ( $meta_fields as $key => $values ) {
                        foreach ( $values as $value ) {
                            add_post_meta( $new_post_id, $key, $value );
                        }
                    }
    
                    // Redirect to the duplicated post
                    wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_post_id ) );
                    exit;
                }
            }
        }
    }
    add_action( 'admin_post_content_duplicator_duplicate_post', 'content_duplicator_duplicate_post' );
    
    

    It even provided a set of instructions after generating the code.

    ChatGPT instructions.
    The code not only comes with instructions, but ChatGPT even says “Please”!

    I then uploaded the new plugin file to the wp-content > plugins directory of my test site using The Hub’s file manager.

    The Hub - File Manager
    There’s a lot of action to unpack in this screenshot.

    And created a dummy post to test the plugin with…

    WordPress test post.
    Did the plugin duplicate this cheesy post? Let’s find out!

    Here are the post’s menu options before activating the plugin…

    WordPress Posts table with single post entry.
    A default post with default options.

    After activating the plugin…

    WordPress Plugins screen - Activate Content Duplicator
    “Activate Content Duplicator” – Sounds like a line from a Star Trek movie.

    Success!

    WordPress Plugins screen - Plugin activated message.
    A gratuitous screenshot proving that the plugin successfully activated.

    The plugin activated. But did it actually work?

    Here’s my test post again (note that the plugin added a new “Duplicate” item to the menu after activation). I then clicked on “Duplicate” to see what happens…

    WordPress Posts Table - Post entry with a new Duplicate item.
    ChatGPT even added a “Duplicate” menu item tooltip to the code!

    And a duplicate post was created!

    An example of a duplicated WordPress post.
    A duplicate of the original post.

    Here’s the table of posts showing entries for the original and duplicated post.

    WordPress Posts table with original post and duplicated post.
    The original post and its cloned version.

    I’m sure that with better prompt engineering and some code tweaking, the plugin could have been significantly improved. For example, I would prefer if the plugin set the post status of the newly-duplicated post to ‘draft’ instead of publishing it, but ChatGPT delivered a simple WordPress plugin that worked. It was basic, but it did the job.

    The last step was to ask someone who codes WordPress plugins for a living to scrutinize the code and get their opinion about using a tool like ChatGPT to code plugins.

    Feedback from Our Expert Plugin Developers

    Shortly after uploading the plugin to one of our testing channels, I got a ping from one of our developers. Here are some of the key points provided in their feedback:

    • “ChatGPT et al are decent at answering questions you already know the answer to.”
    • “I also used it in the past to build a simple plugin for me, but as long as I was giving more complex prompts, it started to mess things around, so eventually I manually debug the given code to work, cause else it’d take ages for it to actually debug it line by line.”
    • “Basically, it does what it says. However, it does what it says very literally. As in, it will duplicate a post and its corresponding postmeta (custom) fields. However, it doesn’t seem like it will propagate any taxonomies to the duplicated post (the plugin should copy and assign the same taxonomy terms, such as categories or tags, from the original post to the duplicated post).”
    • If I was to be super-nitpicky about this, I’d also mention that it’s not L10n-ready – there won’t be an option to translate this plugin. But, that’s just being very nitpicky – I don’t really think, nor would I expect, a prompt-generated plugin to be generic enough to be needing something like that at all. To me, it is more of a “very specific problem domain” kind of a thing, including the language used. At the end of the day, it does do what it says it will, which is very nice.”

    In addition to examining the WordPress plugin code generated by ChatGPT and providing feedback as shown above, our developers also agreed with the following key points after assessing ChatGPT’s current capabilities to generate code:

    1 – It’s important to exercise caution and not blindly accept ChatGPT-generated code as correct.

    • ChatGPT can provide answers, but it’s up to the user to assess whether the answer is correct or not.
    • There is a risk of receiving incorrect or nonsensical answers from ChatGPT, both obvious and subtle.
    • It’s important to exercise caution and not blindly accept the generated code as correct.
    • ChatGPT’s output should be treated as autocomplete, making life easier but requiring caution and verification.

    The ability to discern good code from bad or nonsensical code, however, implies that…

    2 – Users should have sufficient knowledge and understanding of WordPress plugin development to evaluate and modify the generated code as needed.

    • ChatGPT can help simplify and expedite the process of building simple custom WordPress plugins, generate code snippets, and provide explanations. Anything more complex, however, requires plugin development experience and coding skills.
    • Using ChatGPT without sufficient knowledge can lead to negative consequences or unreliable code.
    • Relying solely on ChatGPT without critical thinking is similar to blindly copying the first answer from Stack Overflow (Stack Overflow threads provide more context, multiple answers, and feedback from other users, making it a more reliable resource, but Stack Overflow threads tend to be more generic, whereas ChatGPT can provide specific answers to individual queries).

    3 – Utilizing other resources, such as WordPress documentation, tutorials, and community forums, alongside ChatGPT can provide a more comprehensive understanding of WordPress plugin development.

    • As you explore the possibilities of using ChatGPT for WordPress plugin development, it’s valuable to engage with the WordPress community. Share your experiences, ask for feedback, and seek guidance from experienced developers. Participating in forums, attending WordPress meetups, or joining online communities can provide valuable insights and help you refine your plugin development process.
    • Additionally, consider following WordPress security best practices to safeguard your website from potential vulnerabilities. ChatGPT can provide recommendations on security measures you can implement to protect your plugin.
    • It’s also essential to maintain a clear understanding of your desired functionality and thoroughly review and test the generated code and secure your custom plugins before deploying them to a production environment.

    Can ChatGPT Turn You Into a WordPress Plugin Developer?

    In this article, we’ve explored how you can utilize ChatGPT to build simple custom WordPress plugins, even if you have limited coding experience.

    In other articles, we’ve seen that AI-powered tools like ChatGP can streamline your workflow, boost productivity, and unlock new possibilities (check out our recent article on ways that ChatGPT can help you as a WordPress developer).

    While there are over 60,000 free WordPress plugins available covering every type of functionality you can imagine, sometimes you may need a custom solution to meet a client’s specific requirements.

    Beyond the core functionality of your plugin, you can also leverage ChatGPT to generate code for custom user interfaces. With its ability to understand prompts and generate HTML, CSS, and JavaScript snippets, you can create intuitive admin interfaces, front-end components, and interactive elements that will enhance the user experience and allow you to deliver a polished final product.

    By utilizing the language model’s capabilities, you can generate code snippets, optimize functionality, and create user-friendly interfaces. However, it’s crucial to understand the generated code, review and refine it, and thoroughly test your custom plugins before deploying them to your live website.

    The generated code may also require adjustments to align with coding standards, naming conventions, or specific project requirements. This requires a certain amount of coding knowledge and skills, as does optimizing the code and ensuring it follows WordPress coding guidelines for better maintainability.

    The bottom line:

    Here are my findings after trying to get ChatGPT to code me a plugin from scratch:

    1. I couldn’t have gotten this done without the help of our experienced developers.
    2. Using ChatGPT to generate code without coding knowledge is really challenging – it helps to know what you are doing 🙂
    3. While ChatGPT is a powerful and valuable tool, it doesn’t seem like AI will replace skilled coders any time soon.

    Interested in Developing WordPress plugins?

    Check out some of our tutorials and articles on WordPress plugin development:

    Go to source

  • How to Create Your Company Org Chart in WordPress

    Do you want to create your company org chart in WordPress?

    Organizational charts can help visitors, clients, and potential customers learn more about your business, and find the right person to contact. If you have lots of employees, then an org chart can also help different teams communicate and work together more easily.

    In this article, we will show you how to create a company org chart in WordPress.

    How to create your company org chart in WordPress

    Why Create Your Company Org Chart in WordPress?

    An organizational chart shows how a company is structured, from the CEO right through to the different teams and individual employees within each team.

    A helpful organizational chart can help employees understand how other teams are structured, and who they need to contact in any situation.

    A chart may also be useful to third parties. For example, if you’re creating a client portal then an org chart can help clients find the best person to contact.

    You might even add a company org chart to your public WordPress website, to show the human side of your business and improve your brand’s reputation.

    That being said, let’s take a look at how to easily create and manage a company organizational chart in WordPress.

    How to Create Your Company Org Chart in WordPress

    The easiest way to build an employee chart is by using Organization Chart.

    With this free plugin, you can create charts using a simple visual editor, and add images, links, text, and popups to your company org chart.

    An org chart, created using WordPress

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

    Upon activation, go to Wpdevart Chart » Charts. Then, click on the Add New button.

    How to create a company org chart in WordPress

    This launches the user-friendly visual editor.

    To start, type in a title for the company org chart. This is just for your reference so you can use anything you want.

    Adding a title to a company organizational chart

    By default, Organization Chart adds one element to the chart. Typically, you’ll turn this into the head of your organization, such as the team leader or CEO.

    To add more people to the chart, simply hover over the default element. You’ll now see two small icons: a pencil and an arrow.

    Go ahead and click on the arrow, which adds one element directly below the first one.

    Building an organizational chart in WordPress using a plugin

    Now, simply hover your mouse over this new element and you’ll see three arrows.

    This allows you to add another element to the right or left of this person. Typically, people on the same level in an org chart have the same job title or similar responsibilities.

    Adding multiple levels to a company org chart

    You can also click on the downwards-pointing arrow to create a new level below this person. Usually, people will report to the person above them in an org chart.

    By hovering over each element and clicking on the different arrows, you can easily create your company’s structure. This includes multiple different branches or teams.

    Customizing a company employee chart

    The next step is adding content to each element, such as the person’s name, author photo, or email address.

    To get started, hover over any element and then click on the small pencil icon.

    Adding content to a company staff chart

    In the popup that appears, you’ll need to add a photo of the person.

    Go ahead and click on the ‘Upload’ button and then either choose an image from the WordPress media library or upload a new file from your computer.

    Adding employee images to a hierarchical chart

    After that, type in a ‘Title,’ which will appear directly below the person’s picture. Typically, you’ll want to use the person’s name.

    You can then add a ‘Description,’ which will appear beneath the title. Usually, you’ll want to type in the person’s job title, but you can also add a short sentence about their role.

    Adding a title to an employee chart

    Next, you may want to add a link to the image, title, or description. For example, you might link to a contact form for the person or maybe a page where potential clients can see the employee’s design or photography portfolio.

    To do this, simply type in the URL you want to use. Then, choose the area where you want to add the link using the settings in the ‘Select the link area’ section. For example, you might add a link to the person’s image or description.

    Adding links to a staff chart

    By default, the link opens in the same tab. You may prefer to open the link in a new tab, particularly if you’re using an external URL. To do this, simply check the box next to ‘Open the URL in a new tab.’

    You may want to show more information about each person in the company org chart. For example, you could add their business email address and phone number, bio, a more detailed job description, or any other information you want.

    This plugin lets you create a popup for each person. In this way, you can show detailed information without making the chart look complicated or text-heavy.

    To add a popup, simply click on the ‘Popup’ tab.

    Adding popups to a staff chart in WordPress

    You can now type your messaging into the small text editor. This editor has all the standard WordPress formatting, so you can add links, create a bullet point list, use bold and italic text formatting, and more.

    When you’re happy with the information you’ve entered, you can specify how visitors will open the popup using the settings next to ‘Select the Popup area.’

    How to add popups to a business website

    With that done, click on ‘Update.’

    Now, simply repeat this process for every person in the company org chart.

    Building an employee page using WordPress

    When you’re happy with how the chart looks, click on the ‘Save’ button.

    After that, it’s time to add the chart to your WordPress blog or website. Simply open the page or post where you want to show the company org chart, and then click on the ‘+’ icon.

    In the popup that appears, type in ‘WpDevArt organization chart.’ When the right block shows up, give it a click to add it to the page.

    Adding a block to a WordPress website

    That done, open the ‘Select a Tree’ dropdown and choose the org chart you created earlier.

    When you’re ready to make the org chart live, click on either the ‘Update’ or ‘Publish’ button.

    Publishing an organizational chart in WordPress

    Now, you can visit your business website to see the company org chart in action.

    We hope this article helped you learn how to create your company org chart in WordPress. You may also want to see our guide on how to create automated workflows in WordPress, and our expert pick of the best live chat software for small businesses.

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

    The post How to Create Your Company Org Chart in WordPress first appeared on WPBeginner.

    Go to source

  • How to Add Equipment Rentals to Your WooCommerce Store

    Do you want to add equipment rentals to your WooCommerce store?

    By renting equipment to your customers, you can keep making money from the same product. You can also connect with a new audience who want to rent products rather than buy them.

    In this article, we will show you how to add equipment rentals to your WooCommerce store.

    How to add equipment rentals to your WooCommerce store

    Why Add Equipment Rentals to Your WooCommerce Store?

    By renting equipment to your customers, you can buy a product once and then turn it into an ongoing revenue stream.

    If you already have a WooCommerce store selling digital products or physical items, then equipment rentals can be another way to make money.

    For example, if you sell party hats and paper plates, then your existing customers might also be interested in larger party equipment rentals, such as a bouncy castle or audio speakers.

    You might also be looking to start a completely new equipment rental business. By creating a WooCommerce store that’s optimized for SEO, you can help potential customers discover your business.

    Even better, customers can browse your catalog and reserve equipment online. This convenient customer experience will keep people coming back to your equipment rental business rather than switching to a competitor.

    With that in mind, let’s see how you can add equipment rentals to WordPress.

    How to Add Equipment Rentals to Your WooCommerce Store

    In this guide, we are going to assume you already have a WooCommerce store. If you don’t, then you can see our complete guide on WooCommerce made simple.

    The easiest way to add equipment rentals to your store is by using Bookings for WooCommerce. This WooCommerce plugin allows you to turn any WooCommerce product into a bookable item that customers can rent for a certain number of days or hours.

    An example of rentable equipment, added to the WooCommerce store

    You can also create additional services, such as cleaning and delivery fees, and then add them to your equipment rentals.

    How to Create a Bookable Product in WooCommerce

    First, you will need to install and activate the Bookings for WooCommerce plugin. If you need help, then please see our guide on how to install a WordPress plugin.

    Upon activation, you can turn any WooCommerce product into a bookable product. If you have already added the product to your online store, then simply go to Products » All Products.

    Here, simply hover over the item that you want to turn into a bookable product, and click on the ‘Edit’ link when it appears.

    Editing a rentable WooCommerce product

    You can also add the equipment as a new product by going to Products » Add New. Here, you can type in the product’s name, upload a photo, add product categories and tags, type in a description, and more.

    For more information on how to set up a WooCommerce product, please see our WooCommerce made simple guide.

    Adding equipment and party supply rental products to WooCommerce

    No matter whether you create a new product or edit an existing one, you can turn it into a bookable product in exactly the same way.

    Simply scroll to the Product Data box and open the dropdown menu that shows ‘Simple product’ by default.

    Adding a simple product to an online store using WooCommerce

    You can now select ‘Booking Product.’ This gives you access to lots of new settings where you can configure the bookable product.

    Set How Many Units Customers Can Rent

    You can either offer a set number of units or let the customer choose how many units to rent, using the ‘Quantity’ dropdown.

    Adding bookable products to WooCommerce

    To let customers rent multiple units, select ‘Customer can choose.’

    By default, customers can rent as many units as they want, but you can also add a limit. If a customer types in a higher number, then WooCommerce will show an error message.

    Limiting the quantity of units that customers can rent

    This is useful if you have limited stock or equipment that’s in high demand.

    To set a limit, type a number into the ‘Max Booking Per User’ field.

    Limiting how many units a customer can rent on a party rental or similar website

    Another option is defining how many units the customer can book. For example, if you rent large or expensive equipment such as heavy farming machinery, then customers may only need to book a single unit.

    By setting the quantity in advance, you can remove a step from the booking process and improve the customer experience.

    An example of a rentable product on a WooCommerce website

    Simply go ahead and open the ‘Quantity’ dropdown and then choose ‘Fixed Unit.’

    Now, type in the number you want to use.

    How to change the quantity of equipment or party rental equipment in WooCommerce

    Require Admin Approval For Equipment Rentals (Optional)

    Next, you can decide whether to approve all rental requests automatically or put them on hold until you can manually approve them.

    If you have a smaller inventory, then requiring approval can help you avoid rental overlap. It can also help you spot any problems with rental requests before you take any payments.

    If you enable admin approval, then you will get a notification every time someone submits a rental request.

    A new booking notification, on a WordPress website

    Click on this notification, and you will go to WooCommerce » Orders.

    Here, you will see all the orders on your WordPress website, with any new bookings marked as ‘On hold.’

    Requiring admin approval on a party equipment rental or similar website

    You can now click on a new order to see all the information about that booking.

    If you want to change the order status, then you need to open the ‘Status’ dropdown and choose an option from the list.

    For example, if you are approving the booking, then you might select Pending Payment, Completed, or Processing, depending on your workflow.

    Changing the order status on an equipment rental website using WooCommerce

    With that done, click on ‘Update’ to save your changes.

    As you can see, admin approval gives you more control over your equipment rentals. To require approval, check the box next to ‘Booking Confirmation.’

    How to require admin approval on an equipment rental website

    Offer Hourly or Daily Equipment Rentals in WooCommerce

    By default, customers can rent your equipment for one or more days. However, sometimes you may want to rent equipment based on hours.

    To make this change, just open the ‘Booking Unit’ dropdown and select ‘Hour(s).’

    How to rent equipment based on hours

    You can then choose the start and end time for the booking period, using the ‘Daily booking…’ dropdown menus.

    In the following image, customers can only rent equipment between 9 AM and 5 PM.

    How to change the duration of rentable equipment in WordPress

    After making this change, WooCommerce will add a section where customers can choose a start and end time.

    This is perfect for equipment that people only need for a very short period of time. For example, if you provide party equipment rental, then customers may only need the party supplies for a few hours.

    How to rent equipment based on days and hours

    Add Base and Additional Costs

    When you are happy with the information you have entered so far, you need to click on the ‘Costs’ tab.

    To start, just type in the Booking Unit Cost, which is the price of booking a single unit.

    How to add a cost to a rentable product in WooCommerce

    After that, you can add an optional additional cost by typing into the ‘Base Cost’ field.

    This might be a booking fee, cleaning fee, or any other cost linked to renting the equipment.

    How to add additional costs to a rentable product in WooCommerce

    If you add a base cost, then customers will see it as part of the cost breakdown.

    In the following image, the product is $50 to rent per day, with a base cost of $10.

    An example of a cost breakdown on rentable equipment

    Depending on the kind of equipment you rent, you may want to multiply the fee based on how many people plan to use the equipment. This can help you cover additional wear and tear when lots of people use the same product.

    To multiply the price based on people, start by checking the boxes next to ‘Booking Unit Cost Per Person’ and ‘Base Cost Per People.’

    Multiply the cost of party equipment based on the number of people

    With that done, click on the ‘People’ tab.

    Here, you need to check the box next to ‘Enable People Option.’

    Multiply the price of rentable equipment based on the number of people

    With that done, customers will see a new field where they can type in how many people plan to use the equipment.

    WooCommerce will also show this information in its cost breakdown.

    An example of the cost breakdown on rentable equipment

    You may also want to set the minimum and maximum number of people who can use the equipment in a single booking. This can help to avoid customers misusing your equipment.

    For example, you may not want an entire workforce to use the same product.

    If you have large equipment that’s expensive to deliver or clean, then setting a minimum number of people can help to keep your profit margins healthy.

    To set these limits, simply type numbers into the ‘Minimum No. of People’ and ‘Maximum No. of People’ fields.

    Adding maximum and minimum limits for rentable equipment in WooCommerce

    How to Publish Equipment Rentals to Your WooCommerce Store

    Although there are some extra settings you may want to configure, this is all you need to add equipment rentals to your WooCommerce store.

    With that being said, you can click on ‘Update’ or ‘Publish’ to make the product live on your WooCommerce website. Now, people can rent this equipment directly from the WooCommerce product page.

    How to Set Up Services and Additional Costs for Your Equipment Rental Store

    Sometimes, you may want to create additional costs and services for your equipment rental store. For example, you might offer to deliver the equipment for an extra fee.

    With that in mind, let’s see how you can set up additional costs and services for your WooCommerce store.

    How to Add Additional Costs in WooCommerce

    Additional costs are fees that WooCommerce adds to one or more products automatically. This feature is useful if there are different costs associated with different pieces of equipment.

    For example, you may need to refuel some products after use, while others might need fresh oil.

    By adding these costs in the WordPress dashboard, you can easily apply them to different products. It also provides a single location where you can change the cost.

    For example, if petrol gets more expensive, then you can update your Refueling cost once, and this change will be applied across your entire online marketplace or store.

    An example of a rentable product with additional costs

    As you can see in the image above, additional costs simply appear in the cost breakdown as ‘Additional Costs.’ If you want to give the shopper some more information about these charges, then we recommend creating a service instead.

    To register an additional cost, you need to go to WP Swings » Bookings for WooCommerce. Here, simply click on ‘Configuration Settings,’ followed by ‘Additional Costs.’

    The Bookings for WooCommerce WordPress plugin

    To start, type in a name for the additional cost. This is just for your reference, so you can use anything you want.

    After that, you need to type in the slug you want to use for the additional cost.

    Adding a new booking cost to an equipment rental store

    With that done, you can type in an optional description. This typically won’t appear on your website, but some WooCommerce themes show it.

    Next, simply type the cost into the ‘Booking Cost’ field.

    Adding booking costs to a party equipment rental or similar product

    By default, the additional cost gets added to an order once.

    However, you can multiply the additional cost based on the booking duration or how many people plan to use the equipment. To do this, click to activate the ‘Multiply by No. of People’ or ‘Multiply by Duration’ toggles.

    Multiply a booking by duration and the number of people

    When you are happy with the information you have entered, simply type in ‘Add New Booking Cost.’

    To create more additional costs, simply repeat the same process described above.

    An example of multiple booking costs on a party supply rental website

    With that done, you can add this cost to any WooCommerce product.

    Simply open the product for editing, and then scroll to the ‘Additional Costs’ box.

    Adding extra costs to an equipment rental in WooCommerce

    You can now type in the name of the additional cost.

    When the right option shows up, give it a click and then select ‘Add.’

    The 'Additional Costs' box in a WooCommerce product

    You can click on ‘Update’ or ‘Publish’ to save your changes. Now, when someone rents this equipment, the additional cost will be applied automatically.

    How to Create Additional Services in WooCommerce

    You can also create additional services. Unlike additional costs, the name of the service will appear in the cost breakdown.

    An example of rentable equipment, with additional services

    This helps customers understand your extra fees, so we recommend using services for more expensive charges. It’s also a good idea to use services if you need to add multiple charges to an order so that customers can see a detailed cost breakdown.

    You can also make services optional, so the customer can choose whether to add them to the order. This allows you to offer premium additional services such as next-day delivery.

    To add services to your WooCommerce store, you need to go to WP Swings » Bookings for WooCommerce. Here, click on ‘Configuration Settings,’ followed by ‘Additional Services.’

    Creating additional services for customers on an equipment hire or rentable website

    You can now type a name for the service into the ‘Name’ field.

    This will be shown to customers, so you will want to use something that helps shoppers understand the extra charge.

    How to add an optional service to a party supply rental or similar website

    After that, you have to type in a slug, an optional description, and how much the service will cost by following the same process described above.

    Again, you can choose whether to multiply the fee based on the duration of the booking or the number of people who plan to use the equipment.

    How to add a rentable product to WooCommerce

    You can also make a service optional.

    This means customers can check a box to add the service to their order.

    Offering optional services along with your rentable equipment

    This gives shoppers more control over how much it costs to rent equipment from your WooCommerce store.

    To make a service optional, simply click to enable the ‘If Optional’ toggle.

    Making a service optional on an online store

    Another option is to make the service ‘hidden.’

    Hidden services simply appear on the product page as ‘Service Cost.’

    An example of an optional service, created using WooCommerce

    To make a service hidden, click to activate the ‘If Hidden’ toggle.

    Next, you may want to enable the ‘If has Quantity’ slider. This allows shoppers to add the same service to their order multiple times.

    Adding multiple services to a WooCommerce product

    After clicking to enable the ‘If has Quantity’ slider, you may want to set a minimum and maximum quantity.

    Simply type a number into the ‘Minimum Quantity’ and ‘Maximum Quantity’ fields.

    The Bookings for WooCommerce settings

    When you are happy with the information you have entered, click on ‘Add New Booking Service.’

    To add more services to your online store, simply follow the same process described above.

    Multiple bookings services, added to a rentable equipment website

    When it’s time to add a service, simply open the product for editing.

    Then, just scroll to the ‘Additional Services’ box.

    How to add an additional service to a WooCommerce product

    You can now type in the name of the additional service you want to add.

    When the right option shows up, simply select it and then click on the ‘Add’ button.

    How to add services to party equipment or other rentals

    With that done, click on ‘Update’ or ‘Publish’ to save your changes.

    How to Manage Equipment Rentals on Your WooCommerce Store

    After adding equipment to your website, you will need a way to manage your rental bookings.

    Every time you get a new booking, you will see a notification in the WordPress toolbar.

    A booking notification in the WordPress dashboard

    Simply click on this notification to see all your bookings.

    You can reach the same screen by going to WooCommerce » Orders.

    How to manage rental orders in WooCommerce

    To see more information about an order, go ahead and click on it. This takes you to a screen where you can see detailed information about the order and the customer, including their email address and phone number.

    You can also change the order status, including canceling or refunding the rental request.

    Changing the status of an order on an equipment rental or party supplies website

    The Bookings for WooCommerce WordPress plugin also comes with a calendar that shows all your bookings at a glance.

    To see this calendar, simply head over to WP Swings » Bookings For WooCommerce. Then, click on the ‘Bookings Calendar’ tab.

    An example of a booking calendar for an equipment rental or party supplies rental website

    We hope this tutorial helped you learn how to add equipment rentals to your WooCommerce store. You may also want to learn how to create an email newsletter or check out our expert picks for the best live chat software for small businesses.

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

    The post How to Add Equipment Rentals to Your WooCommerce Store first appeared on WPBeginner.

    Go to source

  • How to Create an Affiliate Product Box (No Coding Required)

    Do you want to create an affiliate product box in WordPress?

    A product box allows you to showcase your affiliate products in a more attractive and eye-catching manner. It can capture your user’s attention and increase the chances of them clicking on your affiliate links.

    In this article, we will show you how to easily create an affiliate product box in WordPress.

    Creating an affiliate product box in WordPress

    Why Create an Affiliate Product Box in WordPress?

    An affiliate product box is used by marketers on their WordPress websites to showcase and promote specific products to readers.

    This box usually contains a product title, images, description, and a call to action (CTA) to promote clicks and purchases.

    Affiliate product box preview

    It is a popular affiliate marketing strategy that can boost sales, increase brand exposure, and save time and resources.

    You can easily add an affiliate product box to a blog post to attract potential customers and earn a commission on any resulting sales.

    That being said, let’s see how you can easily create an affiliate product box in WordPress without using any code.

    You can easily create a product affiliate box using Pretty Links. It is the best affiliate marketing tool that makes it super easy to create and manage affiliate links on your WordPress website.

    First, you need to install and activate the Pretty Links plugin. For more instructions, please see our beginner’s guide on how to install a WordPress plugin.

    Note: Pretty Links also has a free version. However, you will have to purchase the pro version to use the Product Displays addon.

    Upon activation, visit the Pretty Links » Add-ons page from the WordPress admin sidebar.

    From here, simply install and activate the ‘Product Displays’ addon by clicking on the ‘Install Add-on’ box button.

    Install and activate the Product Displays addon

    Once the addon has been activated, just head over to the Pretty Links » Add New page to start creating an affiliate link.

    First, you will have to type the affiliate product name into the ‘Add Title’ field at the top. This title will be displayed as a heading in your product affiliate box.

    After that, go ahead and type the affiliate URL into the ‘Target URL’ box.

    Next, type the link slug into the ‘Pretty Link’ box. This will be the last part of the affiliate URL.

    Create an affiliate link by typing the target URL

    After that, simply switch to the ‘Product Display’ tab from the sidebar on the left.

    Once you are there, you can start by choosing a theme for your product affiliate box from the ‘Theme’ dropdown menu.

    Next, click on the ‘Update Image’ button to upload the product image from the WordPress media library or your computer.

    Choose a theme and upload product image

    After you have done that, simply type the product description into the ‘Description’ box.

    Next, go ahead and set a price for the product in the ‘Price’ box.

    Add product description and price

    You can also add a badge at the top of your product affiliate box. For example, if the item you are promoting is currently on sale, then you can show this to customers.

    To add a badge, simply type the text for it into the ‘Badge Text’ box.

    After that, enter a CTA for the affiliate product into the ‘Primary Button Text’ box. This will be the text displayed on the button within the product affiliate box.

    The affiliate link we created will be automatically added to the CTA button.

    Add a badge and CTA text

    If you have written a review of the affiliate product on your blog, you can add the post’s URL to the ‘Review URL’ box. Readers who click on it will be taken to your review post.

    To add a CTA for the review button, simply type some text in the ‘Review Button Text’ option.

    Once you are done, click on the ‘Update’ or ‘Publish’ button at the top.

    Add the Product Affiliate Box to a Page or Post

    Now, you need to add the product affiliate box to a page or post on your WordPress website. For this tutorial, we will be adding the affiliate product box to a post.

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

    Next, click on the ‘Add Block’ (+) button at the top left corner to locate and add the PL Product Display block to the block editor.

    After that, click on the ‘Add Display’ button.

    Add the PL Product Display box

    This will open up a ‘Product Display’ prompt. From here, simply choose the ‘Single Link’ option from the dropdown menu.

    Once you do that, you will have to search for the affiliate link you created in the search box.

    Add the affiliate product box

    Upon clicking on the affiliate link, the product display box will be automatically added to your post or page.

    Finally, click on the ‘Update’ or ‘Publish’ button to save your changes.

    Now you can visit your website to check out the product affiliate box in action.

    Product box preview

    Method 2: Create an Affiliate Product Box in the Block Editor (Free)

    For this method, we will show you how to easily create an affiliate product box using the block editor.

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

    Once you are there, click on the Add Block ‘(+)’ button in the top-left corner to open the block menu. Next, simply look for and add the Columns block to the post.

    Once you have done that, a list of column variations will be displayed. Simply click on the 50/50 variation to continue.

    Add the Columns block in the block editor

    This will add two side-by-side blocks to your post.

    You can start by clicking on the ‘+’ button on the left side of the screen to open the block menu.

    From here, simply choose the Image block and then add your affiliate product image from the WordPress media library.

    Add the image block and then add product image from the media library

    After that, you need to click on the ‘+’ button in the right column.

    Once the block menu opens up, add the Heading block and type in the product title.

    Add the Heading block and type product title

    Next, simply click on the ‘Select Column’ icon from the block toolbar and then click on the ‘+’ button at the bottom. This will open up the block menu again.

    From here, locate and add the Paragraph block and type a product description into the box.

    Add the Paragraph block to type product descriptions

    Now, to complete your product affiliate box, you will have to add a CTA along with an affiliate link for the product.

    To do that, you will need to exit the block editor.

    Don’t forget to click on the ‘Save Draft’ button to save your changes before going back to the WordPress admin dashboard.

    Create an Affiliate Link

    There are many affiliate marketing tools that you can use to create and manage affiliate links on your WordPress website.

    For this tutorial, we will be using Pretty Links, which is the best WordPress affiliate marketing plugin.

    First, you need to install and activate the Pretty Links plugin. For more instructions, please see our beginner’s guide on how to install a WordPress plugin.

    Upon activation, head to the Pretty Link » Add New page from the WordPress admin sidebar.

    Once you are there, you have to type the product name in the ‘Add Title’ field.

    Next, simply copy and paste your affiliate product URL into the ‘Target URL’ box.

    Create pretty link

    You can now enter a custom URL slug in the ‘Pretty Link’ box. Pretty Links will use this at the end of the affiliate URL that it creates for you.

    Once you are done, click on the ‘Update’ button to generate your affiliate link.

    You will now be redirected to the ‘Links’ page. From here, simply copy the affiliate link from the ‘Pretty Links’ column.

    Copy the affiliate link

    Add an Affiliate Link to the Product Box

    Next, you need to head back to the blog post where you were creating the affiliate product box.

    Once you are there, just click on the right column of your Columns block to open up the block toolbar, followed by the ‘Select Columns’ button. This will open the block menu.

    Next, simply add the Buttons block.

    Add the buttons block in the right column

    To add a link, click on the ‘Link’ icon in the ‘Buttons’ block toolbar. This will open a popup box where you must paste the affiliate link you copied from the Pretty Links page.

    You can also search for the affiliate link using the search bar in the box.

    Add an affiliate link

    Lastly, you will need to add some text to your CTA button.

    Make sure to add an exciting phrase as your CTA to encourage customers to click on the link.

    Type CTA text

    You can also style your affiliate product box using block settings. To do this, simply click on the ‘Styles’ icon in the Block Settings column.

    From here, you can choose the background and text color of your affiliate product box using the Color Picker.

    Choose a background color for the product affiliate box

    Finally, click on the ‘Publish’ or ‘Update’ button to save your changes.

    This is how the affiliate product box looked on our demo website.

    Product affiliate box preview

    Method 3: Create a Product Box For Affiliate Landing Pages Using SeedProd

    If you want to create an aesthetically-pleasing product box for custom affiliate landing pages, then this method is for you.

    You can use SeedProd, which is the best WordPress page builder plugin on the market. It helps you create a visually-appealing website without any code.

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

    Note: SeedProd also offers a free version. However, we will be using the premium version because it offers more design features.

    Upon activation, you must visit the SeedProd » Settings page to enter the plugin license key.

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

    Paste license key in the field

    Next, simply head over to the SeedProd » Landing Pages section from the WordPress admin dashboard and click on the ‘Add New Landing Page’ button.

    For this tutorial, we will be adding an affiliate product box to a landing page.

    Click the Add New Landing Page button

    You will now be taken to the ‘Choose a New Page Template’ screen.

    From here, you can choose any of the pre-made templates offered by SeedProd.

    After you have made your choice, you will be asked to enter a page name and choose a URL. Go ahead and click on the ‘Save and Start Editing the Page’ button after entering the details.

    Enter your page details

    This will launch SeedProd’s drag-and-drop page builder.

    From here, find the Columns block in the left sidebar and drag it onto the design interface on the right.

    Upon adding the block, you will be asked to choose a column layout. You need to simply click on the 50/50 variation to add two side-by-side blocks.

    Add the Column Block in SeedProd

    You can now start by dragging and dropping the Image block into the left column.

    Next, click on the Image block to open up its block settings in the sidebar. From here, simply click on the ‘Use Your Own Image’ button to select the affiliate product image from the media library or upload it from your computer.

    Choose an affiliate product image from the media library

    After that, just drag and drop the Heading block into the right column and add the affiliate product title.

    You can adjust the alignment and font size using the settings in the left sidebar.

    Add the heading block and type product title

    Once you have done that, you need to drag and drop the Text block under the product title. You can add a description for the affiliate product you are promoting.

    After that, simply click on the ‘Save’ button to store your changes.

    Add product description and click Save button

    Now it is time for you to create an affiliate link.

    Create an Affiliate Link

    First, you need to install and activate the Pretty Links plugin. For more detailed instructions, please see our beginner’s guide on how to install a WordPress plugin.

    Upon activation, go to the Pretty Link » Add New page from the admin sidebar.

    Here, you can start by typing the product name in the ‘Add Title’ field to make it easy to find the affiliate link. Simply enter the name of the affiliate company or the product itself.

    Next, add the affiliate link next to the ‘Target URL’ option.

    After that, type a slug into the ‘Pretty Link’ box. This slug will appear at the end of your affiliate link.

    Create an affiliate link

    Finally, go ahead and click on the ‘Update’ button to generate the link.

    You will now be redirected to the ‘Links’ page. From here, simply copy the affiliate link from the ‘Pretty Links’ column.

    Copy the affiliate link

    Add the Affiliate Link to the SeedProd Product Box

    After copying the affiliate link, you need to open the SeedProd landing page where you are designing the affiliate product box.

    Once you are there, simply drag and drop the Button block under the product description.

    Drag and drop the Button block in the product box

    Next, you need to click on the button to open up its block settings in the left sidebar. Here, you must copy and paste the affiliate link into the ‘Link’ box.

    After that, just enter some text for the CTA into the ‘Button Text’ box.

    Add the affiliate link and CTA text

    To style the affiliate product box, you need to select the Columns block to open up its settings in the left sidebar.

    From here, you can choose a background color or even add a background image to your product box. You can also adjust the width and alignment of the Columns block according to your liking.

    Change the affiliate product box background color in SeedProd

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

    This is how the affiliate product box looked on our demo website.

    SeedProd preview of the affiliate product box

    We hope this article helped you learn how to add an affiliate product box in WordPress. You may also want to see our article on how to easily add an affiliate program in WooCommerce and our top picks for the best affiliate tracking and management software 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 Create an Affiliate Product Box (No Coding Required) first appeared on WPBeginner.

    Go to source