Category Archives: WordPress

How To Prevent Hotlinking On Website Files Using cPanel?

Protecting your website’s files from hotlinking is essential for preserving bandwidth and securing your content, and cPanel makes this process straightforward. Hotlinking occurs when other sites link directly to your images, videos, or other files, causing them to load on external pages without your permission, which can drain resources and slow down your site.

With cPanel’s built-in hotlink protection, you can quickly set restrictions to block unauthorized websites from accessing and displaying your files. This guide will walk you through the steps to enable hotlink prevention on cPanel, helping you safeguard your content, reduce bandwidth theft, and maintain optimal website performance.

Start by logging into your Sangkrit.net account and then launch your hosting’s cPanel

Scroll down to ‘Security’ section and click ‘HotLink Protection’ icon.

Hotlinks Protection

This will direct you to a page showing you option for enabling and disabling hot links. By default it provides you a list including all domains and URLs of your websites where you can turn on hotlinking.

Hotlinks Protection 2

The list is editable, you can manually include or exclude domains and URLs to prevent hot links. It also provides you a text area to block access for selected file types and extensions like .jpg, .png etc.

The last text field allows you to redirect hotlink requests to a custom URL, may be your website’s home page or whatever you like.

If you are running your website over WordPress then you may also try Hotlink Protection plugin which is an easy step script coded to stop others from stealing images from your website. Another plugin called Hot Link Prevention offers you a tick-mark option to prevent images from hotlinking.

How To Restrict Image Upload Size In WordPress?

In a multi-author WordPress blog, maintaining image quality and controlling image file sizes are crucial for ensuring optimal website performance. Unoptimized images can slow down your site, especially if contributors don’t resize or compress their images before uploading.

Although WordPress sets a general file upload limit, it may still allow images that are too large, potentially impacting your website’s loading time. This is where the Restrict Image Upload Size plugin can help.

Plugin To Restrict Image Upload Size

The Restrict Image Upload Size plugin allows WordPress administrators to set specific upload size limits just for images, ensuring consistent quality and faster site performance. It provides custom settings to restrict the minimum width and height of uploaded images, making it an ideal solution for e-commerce sites, portfolios, and multi-author blogs.

The plugin offers several features tailored for image management on WordPress:

  • Set Minimum Width and Height: Administrators can set minimum width and height requirements for uploaded images. This helps prevent users from uploading low-resolution images that may not fit your website’s design standards.
  • Custom Error Messages: The plugin lets you set specific error messages that will notify users if their uploads don’t meet the required dimensions.
  • User-Friendly Interface: The settings are easily accessible from the WordPress dashboard, specifically from the Media Settings page, making it simple to configure and manage.
  • Selective Size Restriction: Unlike WordPress’s general upload limit, this plugin restricts image sizes without affecting other file formats like audio and video. This selective restriction allows flexibility in uploading large multimedia files when needed.
Step-By-Step Guide To Restrict Image Upload Size

To restrict image upload size with this plugin, follow these steps:

Step 1. Install and Activate the Plugin

Go to the Plugins section in your WordPress dashboard, click Add New and search for Restrict Image Upload Size. Install and activate the plugin.

Step 2. Configure Settings

After activation, go to Settings > Media in your WordPress dashboard.

You’ll find new options to set minimum width and height requirements for images. Enter your preferred values for these dimensions based on your website’s design needs.

Step 3. Customize Error Messages

In the same settings page, you can also customize the error message that users will see if their image upload doesn’t meet the specified dimensions.

This makes it easier to guide users on the required image quality standards for your site.

Why Use the “Restrict Image Upload Size” Plugin?

This plugin is particularly beneficial for:

  • Maintaining Quality Standards: Ensuring all uploaded images meet specific quality standards helps maintain visual consistency across your site.
  • Improving Website Performance: By restricting large image uploads, you reduce the chances of slowing down your website, which can improve user experience and SEO rankings.
  • Easing Site Management: For multi-author blogs, the plugin helps administrators manage image uploads more effectively, minimizing issues related to oversized images.
The Plugin Is Ideal For
  • E-commerce Sites: High-quality images are crucial for product pages, and this plugin ensures image uploads meet quality standards.
  • Portfolio Websites: Artists, photographers, and designers can maintain image quality without risking oversized files that might affect loading speed.
  • Multi-Author Blogs: For blogs with multiple contributors, the plugin ensures all authors upload images that align with the site’s standards, enhancing the overall look and feel of the blog.

The Restrict Image Upload Size plugin is an excellent tool for WordPress site administrators who want to maintain control over image uploads. By setting minimum width and height requirements, you ensure images meet a consistent standard and don’t negatively impact site performance. This plugin makes image management easy, efficient, and SEO-friendly, ultimately helping you deliver a high-quality user experience on your WordPress website.

If you use a framework other than WordPress then you can also restrict image or any file upload size using cPanel.

Streamline WordPress Tasks With Fast Admin Menu Search

Navigating through WordPress can become quite a task, especially for administrators managing complex sites or those with numerous plugins. The default WordPress admin menu, though functional, doesn’t always facilitate quick access to the various menus and sub-items that an admin may need to access frequently. This is where the Admin Menu Search (AMS) plugin steps in, revolutionizing the admin experience with its intuitive search functionality that simplifies and accelerates menu navigation.

In this article, we explore the key features of the AMS plugin, its benefits, and how it enhances the efficiency of WordPress administration.

Core Benefits Of The Admin Menu Search

Admin Menu Search (AMS) is crafted to provide a seamless and accessible search experience directly from the WordPress admin area. Here’s a closer look at its defining features:

Quick Search of Menu and Sub-Menu Items

AMS enables administrators to search through both menu items and their sub-items with ease. No longer do users need to hunt down specific menu sections; simply entering keywords relevant to the desired menu item will display the relevant options instantly. This is particularly useful for WordPress sites with a significant number of plugins, each adding its own menu or sub-menu items.

Support for Multiple Keyboard Layouts

One of the standout features of AMS is its ability to accommodate different keyboard layouts. Often, users may inadvertently leave a different language or keyboard layout active, which can lead to typing errors or the need to switch layouts. With AMS, administrators can enter text in English regardless of the current keyboard setting, and the plugin will still deliver the desired results accurately. This feature is especially beneficial for multilingual sites or users who toggle between layouts frequently.

Easy Access with a Fixed Admin Bar Search Field

AMS adds a dedicated search field at the very top of the WordPress admin bar, making it a permanent feature that is always accessible. This field remains visible regardless of which admin page is open, ensuring that users can perform quick searches at any time without navigating away from their current page. This positioning is invaluable for busy administrators who often need to multi-task and require prompt access to different site settings.

Keyboard Shortcuts for Efficiency

For power users who prefer to work with keyboard shortcuts, AMS offers a unique advantage. By pressing the slash key (“/”), users can instantly focus on the search field, bypassing the need to click on the field manually. This shortcut is a great time-saver, allowing users to initiate searches within seconds.

Additionally, AMS includes a shortcut to clear the search field instantly. By pressing the “Esc” key when the field is in focus, the input is erased, restoring the display of all menu items. This small yet effective shortcut eliminates the need for repetitive backspacing or manually clearing the field, further enhancing workflow.

How To Use Admin Menu Search?

Getting started with AMS is straightforward. After installation, the plugin automatically adds the search field to the admin bar. The intuitive placement and ease of use mean there is no need for a steep learning curve. Admins can simply start typing in the search field or use the shortcuts to immediately begin benefiting from the plugin’s functionality.

Here’s a quick setup guide:

  1. Install and Activate AMS – Simply install the AMS plugin through the WordPress dashboard or by uploading it manually. Once activated, the search field will appear at the top of the admin bar.
  2. Start Searching – Use the search field to enter keywords or menu items as needed. The results will be displayed in real-time, allowing for quick access.
  3. Use the Keyboard Shortcuts – Press “/” to focus on the search field and “Esc” to clear it, making navigation even faster.

The AMS plugin brings a range of benefits to WordPress administrators, whether managing single or multisite installations. Here’s how AMS can positively impact your site administration:

Enhanced Efficiency and Productivity

The AMS plugin significantly reduces the time spent navigating the admin dashboard. With its quick search functionality, administrators can locate and access specific menu items in moments. This efficiency is especially valuable when working under time constraints or handling urgent updates, allowing admins to perform their tasks without unnecessary delays.

User-Friendly Interface and Accessibility

AMS offers a clean, unobtrusive addition to the admin area with a user-friendly interface. The search field’s placement on the admin bar is convenient and ensures that it doesn’t interfere with the existing menu structure. For new or less experienced WordPress users, this accessibility makes the admin experience more intuitive and less overwhelming.

Error Reduction with Keyboard Layout Flexibility

Typing errors due to incorrect keyboard layouts can be frustrating, particularly for users managing multilingual content or switching between languages. AMS’s compatibility with various keyboard layouts minimizes these errors, ensuring accurate search results regardless of the layout. This is particularly beneficial for administrators in non-English-speaking regions or those who manage international websites.

Improved Workflow for Power Users

For administrators accustomed to using keyboard shortcuts, AMS offers a faster, smoother workflow. By incorporating the slash (“/”) shortcut for focusing on the search field and the Esc key to clear it, the plugin provides an optimized experience for power users. These shortcuts allow admins to maintain a faster pace, improving productivity in day-to-day tasks.

Finally, Admin Menu Search (AMS) is a valuable addition to any WordPress admin’s toolkit. By simplifying the search and navigation of menu items, providing flexibility with keyboard layouts, and offering helpful shortcuts, AMS significantly enhances the admin experience. This plugin not only saves time but also reduces the potential for error, ensuring a more streamlined and efficient workflow for WordPress administrators. Whether managing a single site or a network of sites, AMS can transform how you interact with the WordPress dashboard, making it an indispensable tool for modern WordPress site management.

How To Schedule WordPress Menus With Expiration Dates?

The Menu Expiration Control plugin is an essential tool for WordPress users looking to add flexibility and control over their website’s menu display. With this plugin, you can set specific start and expiration dates for each menu item, making it perfect for temporary promotions, seasonal offerings, or event-based menu items.

Whether it’s a limited-time offer, a seasonal special, or a date-specific announcement, this plugin provides a seamless way to ensure your menus are always relevant to your audience.

Why Use the Menu Expiration Control Plugin?

The Menu Expiration Control plugin allows you to manage menu items more dynamically by setting start and expiration dates. Here’s what makes this plugin valuable:

  • Control Visibility of Menu Items: Show or hide menu items based on specific timeframes, ensuring that your navigation is always up-to-date.
  • Perfect for Promotions & Events: Easily schedule when a promotional link or event announcement should appear or disappear from your menu.
  • Seasonal Menus Made Easy: Set visibility dates for seasonal offerings or limited-time items, such as holiday promotions or special menus.
Key Features Of Menu Expiration Control Plugin:
  • Date-Specific Display: Choose exact dates for each menu item to be visible, ideal for items that should appear only during particular times.
  • Customizable Date Format: The date format is set as YYYY-MM-DD by default, but advanced users can modify this directly within the plugin’s code.
  • User-Friendly Interface: Manage dates right from the ‘Appearance’ > ‘Menus’ section in the WordPress admin panel, without the need for coding skills.

This plugin is especially useful in scenarios such as:

  • Seasonal Campaigns: Automate the display of holiday-themed menu items, like Christmas sales, New Year offers, or Halloween specials.
  • Limited-Time Promotions: Set menu items for flash sales or exclusive discounts, ensuring they only appear for the duration of the campaign.
  • Event Announcements: Control visibility of links for upcoming events, webinars, or local gatherings without manually updating the menu.
How To Use the Menu Expiration Control Plugin?

Follow these simple steps to install and start using the Menu Expiration Control plugin:

  1. Install and Activate the Menu Expiration Control plugin.
  2. Navigate to Appearance -> Menus in the WordPress admin area.
  3. Open any menu for editing or select Create a new menu at the top of the page
  4. Enter a name for your new menu in the Menu Name box and click the Create Menu button.
  5. Locate the left pane to select the pages, categories, custom links etc that you want to add to your menu.
  6. Click the Add to Menu button located at the bottom of this pane to add your selection(s) to the menu.
  7. Set specific start and expiration dates to any menu item for customized display.
  8. Click the Save Menu button.

By using Menu Expiration Control not only enhances your website’s functionality but also improves user experience by ensuring visitors see only relevant, time-specific menu items. By keeping your site’s navigation current, you provide a more organized, user-friendly experience that is sure to keep visitors engaged.

With its easy setup and powerful functionality, the Menu Expiration Control plugin is a must-have for any WordPress site looking to optimize their menus with time-sensitive content.

How To Tag Posts For SEO, Image Updates & Analysis By Authors In WordPress?

You can enhance WordPress editing process and work flow by tagging the post for advancing SEO, image updates, and further team reviews on your WordPress site.

Managing content in WordPress can become a daunting task, especially when you have numerous posts, pages, or custom post types. The ‘Internal Tags‘ plugin simplifies this process by allowing you to create internal tags, making content organization and workflow management much easier. This plugin enables you to set internal tags on various content types, providing a powerful tool to categorize and manage your posts directly from the WordPress dashboard.

What Are Internal Tags?

Internal tags are customizable labels that can be applied to posts, pages, or custom post types within the WordPress dashboard. Unlike public-facing tags used for categorizing content on the front end, internal tags are designed specifically for backend management.

For instance, they can help you track content that requires attention from a specific team, needs additional media, or is pending SEO optimization.

Key Features of the ‘Internal Tags’ Plugin

The plugin offers a wide range of features aimed at enhancing your content management experience:

  1. Unlimited Internal Tags: There is no limit to the number of internal tags you can create. You can define as many tags as you need to suit your content management workflow.
  2. Customizable Tag Names, Descriptions, and Colors: Each tag can be given a unique name, description, and color for easy identification. Tags can be color-coded to provide visual cues at a glance.
  3. Hierarchical Tag Structure: You can create parent-child relationships among tags, allowing for a more organized structure and a better way to segment your content.
  4. Visible Tags in the Posts List: Once a tag is set, it appears alongside your posts in the WordPress dashboard, giving you a clear overview of the status of each post.
  5. Filter Posts by Tags: The plugin allows you to filter the list of posts based on internal tags, making it easier to find content that requires action.
  6. Bulk Edit and Quick Edit Options: Internal tags can be quickly set or modified for multiple posts using bulk editing or the quick edit function.
  7. Enable on Chosen Post Types: You have the flexibility to enable internal tags on posts, pages, or custom post types, depending on your requirements.
  8. User Role Capabilities: You can choose which user roles can view and manage internal tags, ensuring that only authorized users have access.
  9. Display Options: The tags can be displayed in either horizontal or vertical modes, with an optional compact display mode for a cleaner interface.
  10. Default Tag Colors: You can set default colors for tags that do not have a specific color assigned.

How to Use the ‘Internal Tags’ Plugin

To get started, install the ‘Internal Tags’ plugin and navigate to Settings > Internal Tags in the WordPress dashboard. Here, you can choose which post types will utilize internal tags.

After enabling the plugin for the desired content types, a new Internal Tags menu will appear under the post types menu. Creating a new tag is simple: just click on the menu, add the tag details, and configure its color and description.

Once the tags are set up, they can be applied to posts during creation or editing. The tags will be displayed on the right side of the editor, and you can view or filter posts based on these tags in the dashboard.

The ‘Internal Tags’ plugin is a valuable tool for WordPress users looking to streamline content management and improve workflow efficiency. With its customizable options and easy integration, it enhances the organization of your website’s content like never before.

How To Enable mod_expires With WordPress Plugins For A Better Site Performance?

If you’re using WordPress, you can enable mod_expires and set up caching rules easily using plugins. This method doesn’t require manual server configuration and can help you boost your website’s speed.

Several WordPress plugins can enable mod_expires and set up caching rules. Popular options include: WP Super Cache, W3 Total Cache, WP Rocket, and Hummingbird. For this lesson, let’s focus on W3 Total Cache and WP Super Cache, as they are free and commonly used.

To enable mod_expires through WordPress plugins, you can set up caching rules without manually configuring the server. This helps to improve your website’s loading speed and overall performance. Here’s how to do it using popular caching plugins for WordPress.

Step 1 Installing W3 Total Cache Plugin

Start by installing and activating the W3 Total Cache plugin. Navigate to the WordPress Dashboard, go to Plugins, then Add New, and search for W3 Total Cache.

Step 2 Enabling mod_expires With W3 Total Cache

After activation, go to Performance > Browser Cache in the WordPress dashboard. There, you will find an option to enable the “HTTP (Expires) Header” for different content types, such as CSS, JavaScript, and HTML.

Make sure to check the box for each relevant type and configure the expiration settings.

For example, you could set the “Expires header lifetime” to one week for CSS and JavaScript, while setting it to one month for images. Don’t forget to save your settings and purge the cache afterward.

Step 1 Installing WP Super Cache Plugin

Start by installing and activating the WP Super Cache plugin. Navigate to the WordPress Dashboard, go to Plugins, then Add New, and search for WP Super Cache.

Step 2 Enabling mod_expires Using WP Super Cache

Activate the WP Super Cache plugin. Next, go to the WordPress Dashboard, select Plugins, and then Add New. Search for WP Super Cache, install it, and activate the plugin.

Now, head over to Settings > WP Super Cache > Advanced. In this section, you will find an “Expiry Time & Garbage Collection” area.

Enable the “Cache HTTP headers with expires” option, and set an appropriate expiration time for your content.

For instance, 3600 seconds (1 hour) may work for dynamic content, whereas static files like images could have a longer expiration period. Once you’ve made these adjustments, update the status.

Step 3 Verify That Cache Is Working (Common Step)

Clear your site cache through the plugin’s settings to apply all changes. You can then check the HTTP headers using the developer tools in your browser or online services like GTmetrix. This will help confirm that the “Expires” or “Cache-Control” headers are correctly set.

By following these steps, you can easily enable mod_expires through plugins like W3 Total Cache and WP Super Cache, optimizing caching rules for better website performance without directly modifying server configurations.

How To Redirect Users By Their Country In WordPress?

The IP2Location Redirection plugin is a powerful WordPress tool that allows website owners to manage redirection tasks based on visitors’ geolocation, identified through their IP address. It supports country and region-based redirection to a specified URL or custom page, making it ideal for handling 301 and 302 redirects without needing expertise in server configurations like Apache .htaccess.

Common Features:

  • You can set up multiple redirection rules as needed for different countries or regions.
  • It supports IPv4 and IPv6, making it flexible for all IP addresses.
  • It helps improve SEO by reducing old or broken links.
  • You may configure logging and display custom messages for blocked visitors.

The plugin supports both IPv4 and IPv6, utilizes IP2Location’s IP geolocation data, and offers flexible redirection rules, helping improve SEO by managing old or broken links effectively.

Step 1: Install and Activate the Plugin

Start by installing the IP2Location Redirection plugin. In your WordPress admin dashboard, go to Plugins > Add New, search for the plugin by name, and click Install Now. Once installed, activate it. This plugin is highly recommended for handling redirection based on country or region using IP address geolocation.

Step 2: Configure the Basic Settings

Navigate to IP2Location Redirection > Settings in the dashboard. Here, you will configure the initial settings:

  • Default Redirection Behavior: Choose the default action, such as redirecting to a specified URL or blocking access for certain countries.
  • Geolocation Data Setup: The plugin supports both IP2Location IP geolocation BIN data and web service for geolocation lookup. If you choose to use the BIN data, download the file from the IP2Location website and upload it to your server. Make sure to update the BIN data monthly via the settings page for accurate results.

Step 3: Add Redirection Rules

Go to IP2Location Redirection > Rules and click Add New Rule to create a country or region-based redirection rule:

  • Rule Name: Give a descriptive name for easy management.
  • Country or Region: Select the country or region you want to target for redirection.
  • Redirection URL: Specify the destination URL for visitors from the selected location.
  • Redirection Type: Choose between 301 Permanent or 302 Temporary redirection.
  • Source URL: Leave it empty to apply site-wide redirection, or specify a specific page.
  • Additional Conditions: Configure optional conditions, such as user agent, referrer, or URL parameters.

Step 4: Save and Activate the Rule

After setting up the parameters, click Save Rule to activate it. This rule will now redirect users to the specified URL based on their IP geolocation.

Step 5: Testing and Verification

To verify that the redirection is functioning correctly, simulate visits from the selected country using a VPN or proxy. Ensure the visitors are redirected according to the configured rules.

The IP2Location Redirection plugin is powerful yet simple, allowing website owners to manage redirections without needing to be familiar with Apache .htaccess configurations.

How To Control Post Visibility In WordPress By User Roles, Login Status, Memberships & Password Protection?

WordPress site owners can easily acquire complete control over the visibility of posts. They can set which group of people can see what specific content on their website. This lesson guides you on making certain posts, pages, and other custom post types visible only to specific users such as logged-in users, users by their roles, and users with passwords to view the content.

How To Control WordPress Posts Visibility?

The edit screen of every post and page has a settings sidebar on the right, and there are two sections; Post and Block.

In the post section, there is a ‘Summary’ meta box that offers a visibility option as ‘Status’ on the top.

If you click the link next to ‘Status’ it shows you options to keep any post public make it private, or password protected.

How To Make Any Post Private In WordPress?

When you make any post private it becomes visible only to the site administrator and editors. Simply follow the steps:

  1. Create a new post or open any old post for editing
  2. On the right sidebar, click the ‘Post’ block
  3. Under the post section on top, click ‘Published’ or ‘Draft’ next to the ‘Publish’ option
  4. It will show you three options: Public i.e. default option, Private, and Password Protected
  5. Since you are making the post private select the ‘Private’ option
  6. Publish/Update the post and it will become private

The option makes the post private i.e. hidden from the logged-out users and visible only to the site admins and editors. These posts are hidden from subscribers, readers, feeds, and searches.

How To Show/Hide WordPress Posts Based On The User Roles?

As you can see, private posts are only visible to site admins and editors but what if you want to make certain posts visible selectively to specific user roles such as subscribers, authors, contributors, etc? You can do that also with any of the following plugins:

  1. Advanced Access Manager – The plugin enables you to manage access to your website content for any user role, individual user, or visitor. It also allows you to configure the default access to all posts, pages, custom post types, categories, and custom taxonomies.
  2. Membership Plugin – Restrict Content – The plugin offers you complete control over who can and who cannot view any content on your WordPress site. 

How To Password Protect Any WordPress Post?

  1. Create a new post or open any old post for editing
  2. On the right sidebar, click the ‘Post’ block
  3. Under the post section on the top right, click ‘Published’ or ‘Draft’ next to the ‘Status’ option
  4. It will show you three options: Public i.e. default option, Private, and Password Protected
  5. Since you are making the post password-protected select the ‘Password Protected’ option
  6. It will ask you to enter a password, enter the password you like to keep on post
  7. Publish/Update the post and it will become password-protected

Now you can share the link and password with those whom you want to read the post. Only the post title will show up on the home page and other archive pages and it would look something like this: Password Protected: Title of the Post.

It will also show this message in the post content area: “This content is password protected. To view it please enter your password below” and a field to enter the password of the post.

Unlike private posts which are completely hidden from logged-out users, a password-protected post shows the title of the post in the way mentioned above.

Now the question arises, is it possible to hide the title and password field of the password-protected post on home and other archive pages? Yes, you can do that also.

How To Hide Password Protected Post Titles From Home & Other Archive Pages In WordPress?

As we have discussed above, when you password-protect any post, the front end of the website shows the post title and a password field so that users with a password can view the post. Now if you want to hide this title and make it visible only to the users with a link and password then follow these steps:

  1. Navigate to Plugins -> Add New page to find and install WordPress Hide Posts, plugin
  2. Upon activation, visit Settings -> Hide Posts page to select where you want to use the plugin such as on posts, pages, or other content types
  3. Now open the password-protected post for editing
  4. Navigate to the ‘Hide Posts’ meta box on the right sidebar
  5. Tick where you want to hide the post such as on the home page, category pages, tags pages, search pages, and other archive pages, etc
  6. Update the post and now the protected title and password field will also be hidden on the front of your website. Only the users with a link would be able to enter the password.

How To Hide Any WordPress Post From Home, Category & Other Archive Pages?

The plugin mentioned above is not just for hiding password-protected posts but it allows you to hide any posts from the home page, category page, search page, tags page, authors page, RSS Feed, REST API, Post Navigation, and Native Recent Posts Widget, etc.

Simply install and activate the WordPress Hide Posts plugin then follow these steps to hide any post:

  1. Visit Settings -> Hide Posts page to select where you want to use the plugin such as on posts, pages, or other content types
  2. Now open the post (you want to hide) for editing
  3. Navigate to the ‘Hide Posts’ meta box on the right sidebar
  4. Tick where you want to hide the post such as on the home page, category pages, tags pages, search pages, and other archive pages, etc
  5. Update the post and the post will get unlisted from the archive pages that you have selected

So these were all important parts of controlling the visibility of posts and pages on your WordPress site.

How To Show/Hide WordPress Menus With Conditional Statements?

You can use each item of WordPress menus with your conditional statements. The plugin allows visibility features to all WordPress menus you manage from the dashboard’s appearance section. It allows you to display or hide menus based on conditional statements such as show/hide this menu if the page is a single page, if a user is logged in etc.

To start, first install and activate the If Menu plugin then visit your area Dashboard -> Appearance -> Menus page and select a menu from the ‘Select a menu to edit‘ drop box. [Read: How To Create & Manage WordPress Menus?]

Let’s say you want to add a ‘Login’ link in your navigation menu but you want to show it only to logged-out users (as it is of no use for logged-in users) then first add the custom login to your menu structure and tick ‘Enable Conditional Logic ‘ checkbox.

As you tick this option it starts showing a show/hide dropdown box with if conditional logic options as shown in the given screenshot. Now select a show or hide option and then choose your visibility conditions.

How To Use Conditional Statements With WordPress Menus?

In the above example, we have selected the hide option with the conditional statement ‘if a user is logged in’ to make the login button automatically disappear for all logged-in users. Alternatively, in the above-given case, we can also use the ‘show’ option for all ‘logged out’ users.

The plugin lets you set basic visibility rules such as the user is logged in, its user role, the page type (front page, archive page, search page single page or post), or the visitor device is mobile. It also offers a premium version with an advanced set of visibility rules such as the visitor’s location, visitor’s language, based on WooCommerce subscriptions or memberships, his WishList, and its subscription level.

How To Create & Manage Menus In WordPress?

In a website, menus are the set of content filter links typically placed horizontally at the top of a website to provide easy navigation. A Menu shows what you are offering on your website.

For example: If you are running a blog on recipes then you can use navigation for offering various dish types like separate menus for dishes, soups, desserts, fast foods, detox meals, etc. In this lesson, we will guide you to the WordPress menu system covering all its important parts so that you can create new menus and add them to specific locations.

Different themes provide you with different menu locations and by default most themes use the page links in navigation menu locations. The reason is generally users create a website with typical pages like About, Contact, and Home, and a blog page. Hence these pages are shown automatically in the menu bar.

But WordPress allows you to create custom menus containing links to pages, categories, and other specific links. So if you don’t want to display pages in a menu location then create menus and assign them to display on a menu location that your theme provides.

How To Create A WordPress Menu?

Step-1: Creating A New Menu

How To Create Menus In WordPress? 1

To create your first WordPress menu, log in to your WordPress admin area (yourdomain.com/wp-admin) then navigate to Appearance -> Menus page, click the create a new menu‘ link, give your menu a name (this is not visible on the front) and click ‘Create Menu‘ link.

Step 2: Adding Menu Items

How To Create Menus In WordPress? 2

After the menu is created, you can add menu items from the left column to the menu structure box. Example: For adding a custom link:

  1. Click ‘Links’ (on the left column)
  2. Type or paste the link
  3. Type link text
  4. Click the ‘Add to Menu‘ button.

Step 3: Creating Multilevel Menus

How To Create Menus In WordPress? 3

After creating navigation links, you can drag-drop to reorder them. You can make navigation go deep by adding submenus. To add a submenu, simply drag and place a menu item a little bit right to its parent as shown in the given screenshot.

Here are the steps to create sub-menus:

  1. Position your mouse over the ‘child’ menu item.
  2. While still holding your left mouse button, drag it to the right and release the mouse button.
  3. You can repeat these steps for each sub-menu item then click the Save Menu button visible in your Menu Editor.

Step 4: Set The Menu Location

How To Create Menus In WordPress?4

After the menu structure is created, assign it to a theme location. Scroll down to the ‘Menu Settings‘ section and choose a theme location.

[heading size=”17″]Step-5: See How It Looks[/heading]
How To Create Menus In WordPress? 5

Visit your website’s home and see what it looks like. Given screenshot shows the menu we have created in the top primary location of the Twenty Fourteen WordPress theme.

How To Manage Multiple Menus?

You can create several menus, and assign them to different locations. If you are using the default Twenty Fourteen then you can add a menu on the top of your website, and another menu in the left sidebar’s vertical menu location. WordPress also provides you a menu widget (in Appearance -> Widgets page) you can use for manually displaying any menu in your sidebar or footer widget area.

How To Create Menus In WordPress? 6

How To Create Menus In WordPress? 7

To manage your menus, menu items, their structure, and location, visit the Appearance -> Menus page and select a menu to edit. Another tab with the title ‘Manage Locations‘ allows you to manage menu locations in bulk.

How To Hide Dashboard Menu Items From Subsite Admins In WordPress?

Do you want to hide some specific admin menu items from subsite administrators on your WordPress multisite network? Superadmins can selectively hide side admin menus and their sub-menus from the admins of other websites on a multisite network or from other users on the website.

How To Hide WordPress Menus & Top-Bar Items?

For a basic single-site WordPress installation, you may use the Hide Admin Menu plugin. Simply install and activate it, after activation visit the ‘Hide Menu’ item on your dashboard.

Here it offers you checkbox options to show or hide the side admin menu as well as the top-bar items.  You simply need to select your options and click the ‘Update’ button.

Admin also can hide menu according to the role of users.

How To Hide WordPress Menus Network Wide?

Another plugin called User Role Editor works both for single and multisite WordPress installations. Simply install and network activate it. Upon activation, navigate to Settings -> User Role Editor on your network admin dashboard.

Select the ‘Administrator’ role, remove the capabilities that you want to remove, tick the “Apply to All Sites” option (so that it applies to all the sites on the network), and save your new settings.

Now check the backend of any of your subsites and you will notice that the selected menu is no more there. Similarly, you can hide other menu pages as well. 

How To Auto Redirect Old Permalinks To New Ones In WordPress?

Changing WordPress default permalinks to a “Post Name” structure is crucial for better SEO, user experience, and readability. Default URLs in WordPress are often unattractive and not informative (e.g., ?p=123). By switching to post name permalinks, the URLs become more meaningful and descriptive (e.g., example.com/sample-post), which helps search engines understand the content better, leading to improved rankings.

Additionally, this format is more user-friendly, making it easier for visitors to remember and share, enhancing your site’s visibility and accessibility. But the problem occurs when you switch to a new permalink structure (Dashboard -> Settings -> Permalinks), your old links archived by search engines or shared on social media become a broken link to your website.

In this lesson, you will learn about auto-redirecting old permalinks to new ones. You can simply change your default WordPress permalinks, switch to SEO-friendly post-name permalinks, and then automatically redirect old permalinks to new ones in one click with the help of a plugin.

WP Permalink Redirect is a WordPress plugin that automatically process permalink redirection on your website. All you have to do is install-activate it and that’s all. The plugin has no configuration page, it immediately starts to work upon activation.

Upon activation, the plugin also removes duplicated content issues and redirects your visitors to the new permalink using a 301 i.e. permanently redirect status code. You can even confirm its working with Google webmaster tools. It also takes good care of website pagination of taxonomies like categories and blog lists to allow them to work normally on your WordPress site.

How To Remove The Tag Base From WordPress Permalinks?

You can remove the base tag slug in the WordPress permalinks structure. Earlier this was done with the help of a plugin or PHP function but now you can do it from your admin area dashboard.

By default the tag URL on WordPress looks something like this – yourdomain.com/tag/tag-name, now we have to remove the tag from the permalink so that URLs should look something like this yourdomain.com/tag-name/.

These steps allow you to remove the tag prefix completely by modifying your site’s permanent link settings.

  1. Navigate to your WordPress dashboard
  2. Navigate to Settings -> Permalinks page
  3. Scroll to Custom Structure and put ‘/%tag%/%postname%/’.
  4. Go to Tag Base and type in a dot “. “
  5. Save your changes.

The tag prefix is removed by typing the dot in the tag base field. It completely removes the mandatory tag base from the tag permalinks, so the tag name comes right after your domain name in the permalink structure.

By default, this field is left blank which represents the default prefix.

How To Remove The Category Base From WordPress Permalinks?

You can remove the base category slug in the WordPress permalinks structure. Earlier this was done with the help of a plugin or PHP function but now you can do it from your admin area dashboard.

By default the category URL on WordPress looks something like this – yourdomain.com/category/category-name, now we have to remove the category from the permalink so that URLs should look something like this yourdomain.com/category-name/.

These steps allow you to remove the category prefix completely by modifying your site’s permanent link settings.

  1. Navigate to your WordPress dashboard
  2. Navigate to Settings -> Permalinks page
  3. Scroll to Custom Structure and put ‘/%category%/%postname%/’.
  4. Go to Category Base and type in a dot “. “
  5. Save your changes.

The category prefix is removed by typing the dot in the category base field. It completely removes the mandatory category base from the category permalinks, so the category name comes right after your domain name in the permalink structure.

By default, this field is left blank which represents the default prefix.

Alternatively, you may add the following rule in .htaccess file present in the root directory of your website :

RewriteRule ^category/(.+)$ https://www.yoursite.com/$1 [R=301,L]

This also removed the category base, don’t forget to replace yoursite.com with your domain. The same can be done with the help of the Yoast SEO plugin. If you are using it on your website simply navigate to Yoast SEO -> Search Appearance and open the ‘Taxonomies’ tab.

Scroll to the Category URLs, select ‘Remove the categories prefix’, and save the changes.

How To Display Outdated Content Alerts With Old Post Notice In WordPress?

The Old Post Notice plugin is a valuable tool for WordPress users managing blogs with large archives. It helps notify visitors when viewing older posts that might contain outdated information. This feature can significantly enhance the user experience, ensuring readers are aware that the content they’re consuming may no longer be current, which is especially important for tech, news, or product blogs that update frequently.

The plugin offers several features that provide flexibility and control over how notices appear on older posts:

  1. Customizable Notices: You can set your own notice text to inform users about a post’s potential outdatedness. This customization includes options for color schemes (background and text) and where the notice appears—above or below the content.
  2. Post Age Settings: You decide how many days old a post should be before the notice is triggered. This allows you to target only significantly older posts while keeping recent articles clear of notices.
  3. Published vs. Modified Date: The plugin lets you choose whether the notice is based on the post’s original publish date or the last modified date. This is useful if you frequently update older posts with fresh information.
  4. Built-in and Custom Styling: It includes a default styling option, but advanced users can disable it to apply their custom CSS.
  5. Control Over Activation: You can easily enable or disable the notice without losing your settings.

How to Use Old Post Notice Plugin?

Once you install and activate the Old Post Notice plugin, follow the given steps of configuration:

Step-1 Navigate to Settings -> Old Post Notice in your WordPress dashboard.

Step-2 Enable the notice by ticking the option. You may customize the notice text, choose the number of days to trigger the notice, and decide whether it’s based on the post’s published or modified date.

Step-3 Adjust the styling options, such as the background and text colors, or apply custom CSS if desired. Then save your changes.

    The notice will automatically display on all posts that meet the given age criteria.

    The plugin lets you keep your blog relevant and transparent, ensuring that your readers are informed about older content. This adds credibility to your site and helps manage user expectations.

    How To Set External Links To Open In A New Tab In WordPress?

    It is easy to link a word and set its target to blank so that it opens in a new tab. Most website owners want to make all external links open in a new window and all internal links open in the same tab, you can make this thing easy and automatic with the help of a plugin.

    Simply install and activate Open external links in a new window on your WordPress site. Once the plugin is activated, navigate to your admin area dashboard Settings -> External Links page.

    By default, the plugin makes all external links open in a new tab but on its settings page, you can type URLs that should either be forced to open in a new window or ignored. Some of the basic features of this plugin include:

    1. It opens up all (or specific) external links in a new window
    2. It produces XHTML Strict compliant and is search engine optimized (SEO)
    3. It can can open external links starting with http:// or https:// in a separate browser window or tab
    4. It handles the links client-side, which lets search engines follow the links properly
    5. It becomes inactive when a browser does not support JavaScript, and hence doesn’t result any errors

    If you need more advanced features, there is another free plugin called WP External Links. This plugin lets you manage all external and internal links on your website by enabling you to control icons, nofollow, no opener, UGC (User Generated Content), sponsored, and yes if links open in a new window or new tab.

    How To Make All Links (Internal & External) Open In New Tab In WordPress?

    You can set all links (internal and external) on your WordPress website to open in a new tab.

    By default all WordPress links open in the same tab, although there is an option in the links box to set specific links to open in a new tab, you can do that while adding a new link in your post or page content. But to make all the links open in a new browser tab, you simply need to add a few lines of JavaScript code to your website which can be done by activating the following plugin.

    The WordPress plugin Open Links In New Tab automatically sets links to open in a new tab. You simply need to install and activate it on your website and that’s all. The plugin provides you an option if you want to set only external links to open in a new tab, or just internal links in a new tab, or both.

    This plugin works by adding a few JavaScript code lines on your website, it doesn’t depend on any external library and doesn’t even require jQuery, which is the most common JavaScript library.

    How To Open WordPress Navigation Menu Links In A New Tab?

    The navigation menu links are the links you display in your website’s menu bar. Managing WordPress menus is easy, its default interface allows you to add menu items from various filters of your website, rearrange them with drag and drop interface, and set their navigation label and title attribute.

    However, some advanced options can be enabled from the ‘Screen Options’ tab present in the top right corner of the menu admin screen. In this lesson, you will see how to make some menu links to open in a new tab.

    Visit your WordPress admin area dashboard and navigate to Appearance -> Menus page. Now click the ‘Screen Options‘ tab and tick ‘Link Target‘ option visible in the ‘Show advanced menu properties’ section.

    This adds a new checkbox ‘ Open link in a new window/tab‘ option on each menu link added to your menu structure. Now all you need to do is tick that option on links that you want to open in a new tab.

    Click Save Menu to apply the updates. This will ensure the selected menu links open in a new tab.

    How To Open Navigation Menu Links In New Tab (Using Block Editor)?

    To open navigation menu links in a new tab in block themes in WordPress, follow these steps:

    1. Navigate to Appearance -> Themes to use the full site editor.
    2. Click on the header section, then select the Navigation Block where the menu is located.
    3. Use the ‘+’ icon to add a link or edit an existing one.
    4. Toggle the option for ‘Open in new tab’ to ON.
    5. Save your changes by clicking the ‘Submit‘ button and then ‘Save’ button at the top.

    You can also open all external links on your website automatically in a new tab or window with the help of a plugin. You will learn about it in the next lesson.

    How To Find & Remove Broken Links In WordPress?

    Broken Link Checker is a popular WordPress plugin that lets you identify and fix broken links on your website. A broken link, also known as a dead link, can negatively impact both user experience and SEO rankings. This plugin scans your website content—posts, pages, comments, etc to detect any non-working URLs, images, or embedded media like YouTube videos that may have been removed or relocated.

    To start removing broken links using the Broken Link Checker plugin on your WordPress site, simply follow these steps:

    1. Install & Activate the Plugin: Install Broken Link Checker from the Plugins -> Add New page and activate it.
    2. Scan for Broken Links: The plugin will automatically begin scanning your site for broken links. You can monitor the scan in your WordPress dashboard under the Link Checker page.
    3. Fix or Remove Links: Once broken links are detected, go to the Broken Links page. You can either: Update the broken link, remove it, or dismiss that it’s not an issue.
    4. Bulk Actions: The plugin allows you to fix multiple links at once using bulk actions for faster management.

    By following these steps, you can keep your WordPress site free from broken links, ensuring a better user experience and preserving SEO rankings.

    The plugin does real-time monitoring and also sends you email as it finds any dead links on your website. You can fix or remove the link from the plugin’s interface.

    How To Add Product Videos In WordPress WooCommerce Website?

    You can add videos to describe or promote your products at your WordPress eCommerce store. This enhances the shopping experience and helps showcase product features effectively.

    Woocommerce allows anyone to build an online shop without technical skills. All you have to do is register your domain name, subscribe WordPress, and install the WooCommerce plugin. Then you can manage your website from its admin interface.

    This lesson will guide you on adding single or multiple videos on any product to its linked featured image or product gallery.

    WPC Product Videos for WooCommerce

    To start you will need to install-activate a WordPress plugin called WPC Product Videos for WooCommerce. Upon activation, open the product you want the video to be added or you can do this while adding a new product.

    The product admin page will show you a newly added field for the video URL, this is next below the featured image section. Simply paste your video URL there and update or publish your product. It boosts product presentation and can improve conversions.

    The plugin works for YouTube and Vimeo videos. Alternatively, you can upload your video from your WordPress Media Library and use then its URL.

    Product Video Gallery for WooCommerce

    Product Video Gallery for WooCommerce is another plugin that allows you to enhance product pages by adding videos to the product gallery. It supports various video formats like YouTube, Vimeo, or self-hosted videos, making it easy for you to display your product through engaging visuals.

    Simply install and activate it on your website and then navigate to Products -> WC Product Video, now tick the checkbox to configure a setting, and then save your changes. The plugin usage is quite simple, to add a video to your product: open the edit product page and insert your product YouTube video URL in {Product Video Url} field. That’s it.

    This plugin lets users upload multiple videos alongside product images, creating a dynamic gallery. It also integrates smoothly with WooCommerce themes, providing a more interactive shopping experience for customers.

    How To Clean Unnecessary Tables From MySQL Database?

    Cleaning unnecessary database tables means deleting tables that were created before by some plugin and now are not in use on your website. Removing such tables lightens up your MySQL database. In this lesson, you will learn about cleaning up a database manually and with plugins’ help.

    Before making any changes, always ensure and be careful when deleting database tables, as removing the wrong ones can break your WordPress site. Always keep a full WordPress database backup.

    Step-1, access your hosting’s cPanel and locate the phpMyAdmin option under the Databases section. Click on it to access the database management interface.

    Step-2 In phpMyAdmin, find your WordPress database on the left-hand side panel. Click on the name of the database to view the tables it contains.

    Step-3 Now identify unnecessary tables. Unnecessary tables might come from uninstalled plugins or themes. Tables that don’t seem to match the standard WordPress table names like wp_posts, wp_users, or wp_options may be safe to delete. Some tables have a prefix based on the name of a plugin (e.g., wp_woocommerce_* for WooCommerce).

    Step-4 Once you identify the tables you no longer need, select them by checking the box next to each table. Then, scroll down and choose Drop from the options in the dropdown menu. Confirm the deletion.

    Automatically Identify & Clean MySQL Database Tables

    Alternatively, You can clean your database with a plugin. Plugins such as WP-Optimize or Advanced Database Cleaner let you automatically identify and clean up unnecessary tables without manually going into phpMyAdmin.

    These WordPress plugins provide you with an easy way to clean up unnecessary database tables from your WordPress site.