How To Stop Comment Spam On Your WordPress Media Attachment Pages

Learn how to prevent spammers posting comments on your WordPress media file attachment pages …

How To Stop Comment Spam On Your WordPress Media Attachment Pages

How To Stop Comment Spam On Your WordPress Media Attachment PagesAre you getting comment spam on your WordPress media attachment pages?

This step-by-step tutorial will show you how to delete comment spam from your media attachments and how to prevent this from happening in the future.

Spammers can be quite devious when it comes to finding new ways to spam your site. Recently, while doing some administration work, I received an automated email notification message from one of my sites that a spam comment had been posted on a media file attachment page …

WordPress comment notification email

(WordPress comment notification email)

My first thought was “How did spammers get to my media files?”

After logging into the site, clicking on the ‘Comments’ menu and verifying that the spam comment had indeed been posted on a media file attachment page, my second thought was … “Oh no! I’ve uploaded a bunch of media files to this site, so I need to shut down hundreds of pages that spammers can target!”

WordPress Comments section

(WordPress Comments section)

I then checked some of the media file attachments pages on the site and saw that the “comments” section was enabled …

Media file attachment page - Comments enabled

(Media file attachment page – Comments enabled)

This was a new site that I had quickly set up and hadn’t finished fully configuring. To prevent further comment spam from being posted on the site through its media attachment pages, I now had to disable the ‘Discussions’ feature for all existing media items.

The tutorial below will show you how to delete comment spam posted to existing media file attachment pages and how to prevent new comment spam from being posted to these pages in the future

How To Delete Comment Spam On Existing Media File Attachment Pages

Useful Tip

Normally, the best way to prevent comment spam is to configure your discussion settings as shown in the tutorial below:

Also, unless certain plugins or features installed on your site require you to upload and use images from the WordPress Media Library, we recommend storing and serving all media used on your website from a media storage and delivery service like Amazon S3.

How To Delete Comment Spam On Existing Media File Attachment Pages Manually

To delete comment spam from existing media file attachment pages, log into your WordPress admin, go to the main menu in your dashboard and select Media > Library …

WordPress Menu: Media > Library

(WordPress Menu: Media > Library)

This brings you to the Media Library screen.

Media Library Grid View

The screenshot below shows items uploaded to your media library displayed as a grid.

To disable comments on media files in the grid view, click on a media element …

WordPress Media Library - Grid Layout

(WordPress Media Library – Grid Layout)

This brings you to the Attachment Details screen.  Click on the ‘View attachment page’ link …

Attachment Details - View attachment page

(Attachment Details – View attachment page)

We need to turn comments off on this page. To do this, click on ‘Edit Media’ in your WordPress admin toolbar

WordPress admin toolbar - Edit Media

(WordPress admin toolbar – Edit Media)

In the Edit Media screen, scroll down to the ‘Discussion’ section and untick the ‘Allow comments’ checkbox to disable comments for that media element’s page …

Edit Media - Discussions

(Edit Media – Discussions)

If you can’t see the Discussion section, scroll to the top of your page and click on the Screen Options tab …

Screen Options tab

(Screen Options tab)

Make sure that the ‘Discussion’ checkbox is enabled in the ‘Boxes’ section …

Screen Options - Boxes > Discussion

(Screen Options – Boxes > Discussion)

After disabling the ‘Allow comments’ checkbox, click Update to save your new settings …

Comments disabled. Update to save your settings

(Comments disabled. Update to save your settings)

Make sure that your media file has been updated. Comments are now disabled for your media attachment page.

Media file updated

(Media file updated)

Useful Tip

Note: If you have sharing features enabled for your media files through a plugin, you may also want to consider disabling sharing options on you media attachments pages (unless you need to leave these turned on) …

Consider disabling sharing features on media attachment pages

(Consider disabling sharing features on media attachment pages)

If using a plugin like Jetpack, for example, you can configure your sharing options to make sure that buttons don’t appear in places where they are not useful or required …

Jetpack Sharing Options

(Jetpack Sharing Options)

Media Library List View

A quicker way to edit your media files attachment pages is to display your media library in ‘List’ view. This way, you can go to the Edit Media screen directly by clicking on the ‘Edit’ link in the Quick Edit menu …

Media Library - Quick Edit > Edit

(Media Library – Quick Edit > Edit)

In the Edit Media screen, disable the ‘Allow comments’ checkbox in the Discussion section to disable comments, then resave the page to update your settings …

Edit Media screen - Disable comments in Discussion section

(Edit Media screen – Disable comments in Discussion section)

What If You Have Too Many Media Elements In Your Media Library … ?

If you have too many media elements uploaded to the WordPress Media Library, then disabling comments for each item manually can become a long and painful task …

What if you have too many media elements to update manually?

(What if you have too many media elements to update manually?)

In this case, we recommend using a plugin.

There are a number of plugins available for WordPress that allow you to disable comments on your site. Let’s take a look at one of these …

Disable Comments

WordPress plugin - Disable Comments

(WordPress plugin – Disable Comments)

Disable Comments is a free WordPress plugin that allows site administrators to disable comments globally on any post type (posts, pages, media attachments, etc.)

It also removes all comment-related fields from edit and quick-edit screens, the WordPress Dashboard, Widgets, the Admin Menu, and the Admin Bar. On multisite installations, it can be used to disable comments on your entire network.

Note: Don’t use this plugin if you want to selectively disable comments on individual posts. This plugin should be used if you don’t want comments at all on your site (or on certain post types), as the plugin settings cannot be overridden for individual posts.

To install the plugin, go to Plugins > Add Plugins and type in “disable comments” in the ‘Keyword’ field …

Plugins > Add Plugins

(Plugins > Add Plugins)

To use the ‘Disable Comments’ plugin, locate the item and click on the ‘Install Now’ button …

Add Plugins > Install Now

(Add Plugins > Install Now)

Click on ‘Activate’ …

Add Plugins > Activate

(Add Plugins > Activate)

After the plugin has been installed and activated, visit the configuration page to configure the plugin’s settings …

Plugin activated

(Plugin activated)

You can also access the plugin settings screen by going to Settings > Disable Comments.

Select the option that best suits your needs (e.g. disable comments throughout your site or only on selected post types – in this case ‘Media’) and click ‘Save Changes’ to update your settings …

Disable Comments screen

(Disable Comments screen)

After configuring and saving your settings, it’s time to check that everything is working as it should.

Go back to your Media Library section by selecting Media > Library from the main menu …

WordPress Menu - Media > Library

(WordPress Menu – Media > Library)

Select a media element that has not been updated yet, and right-click on ‘Edit’ to open the attachment page in a new browser tab …

Media Library - Edit

(Media Library – Edit)

The ‘Discussion’ and ‘Comments’ features should be disabled on the page …

Discussion feature disabled in media attachment page

(Discussion feature disabled in media attachment page)

These features should also have been disabled in the Screen Options tab …

Discussion feature disabled in Screen Options tab

(Discussion feature disabled in Screen Options tab)

And if you visit the media attachment page itself, you should not see the Comments field displayed (No Comments field = No Comment Spam!)

No Comments field = No Comment Spam!

(No Comment!)

Hopefully, this tutorial has helped you with stopping or preventing comment spam from being posted on your WordPress media attachment pages.

How To Stop Comment Spam On Your WordPress Media Attachment Pages

How To Fix Can’t Change WordPress Website Address – Greyed Out URLs

Are your WordPress Address (URL) and WordPress Site Address (URL) greyed out? This step-by-step tutorial shows you how to fix this issue.

How To Fix Can't Change WordPress Website Address - Greyed Out URLsThis tutorial is part of our FREE WordPress Management training and WordPress Troubleshooting tutorial series.

In this series of step-by-step tutorials, we show you how to troubleshoot and fix common WordPress errors.

If you plan to move your WordPress installation to another directory or change your website from ‘http’ to ‘https’, you will need to edit the URLs in your Settings > General Settings section.

If these fields are greyed out, however, the fields will be uneditable  …

WordPress General Settings - Greyed out URLs

(WordPress General Settings – Greyed out URLs)

If you find that your WordPress Address (URL) and Site Address (URL) are greyed out on your Settings > General Settings section, the step-by-step tutorial below will show you how to easily fix this issue.

For help configuring your General Settings section, see this tutorial:

Useful Info

Important: Always do a backup of your WordPress site (files and database) before modifying any files or performing any upgrades or installations! 

If you don’t want to back up your files manually, then get professional WordPress help, or use a WordPress backup plugin.

How To Fix Can’t Change WordPress Website Address – Greyed Out URLs

Greyed out WordPress Address and Site Address URLs can be caused when someone moves or clones a WordPress site but forgets to delete a couple of lines of code or the migration process is interrupted, making the fields uneditable in the General Settings section …

WordPress General Settings - Greyed out URLs

(WordPress General Settings – Greyed out URLs)

To fix this issue, you will need to edit the wp-config.php file in your WordPress installation, either using FTP software, or File Manager in cPanel.

For this tutorial, we’ll use File Manager in cPanel.

How To Edit wp-config.php File Using cPanel File Manager

If your WordPress site is hosted on a server with cPanel installed, log into your cPanel control area and click on File Manager (Files > File Manager) …

cPanel Files - File Manager

(cPanel Files – File Manager)

Most WordPress installations are found inside the ‘public_html’ directory. Double-click on ‘public_html’ to open the directory folder …

cPanel File Manager - public_html directory

(cPanel File Manager – public_html directory)

Locate and select the wp-config.php file …

wp-config.php file

(wp-config.php file)

With wp-config.php selected, click on Edit to open the file (note: we recommend making a backup of the file before editing. To do this, select ‘Download’ first and save a copy of the file to your hard drive) …

File Manager - Edit function

(File Manager – Edit function)

A warning dialog window may pop up reminding you to back up the original file. Click on ‘Edit’ to proceed …

Edit dialog window

(Edit dialog window)

Scroll down through the code in this file until you find the two lines shown below (define ‘WP HOME’ and define ‘WP SITEURL’). The ‘yourdomain.com’ URLs should display your actual domain …

Find these two lines in wp-config.php

(Find these two lines in wp-config.php)

Select only these two lines inside the wp-config.php file, nothing else …

Select define 'WP HOME' and define 'WP SITEURL'

(Select define ‘WP HOME’ and define ‘WP SITEURL’)

Delete only these two lines, nothing else …

Delete define 'WP HOME' and define 'WP SITEURL'

(Delete define ‘WP HOME’ and define ‘WP SITEURL’)

After deleting these two lines of code, the section of your wp-config.php file should look like the screenshot below …

wp-config.php file with define 'WP HOME' and define 'WP SITEURL' lines removed

(wp-config.php file with define ‘WP HOME’ and define ‘WP SITEURL’ lines removed)

Click the ‘Save Changes’ button to save and update your wp-config.php file and then click ‘Close’ to exit the editing window in File Manager …

Save changes in your wp-config.php file

(Save changes in your wp-config.php file)

Log out of cPanel and log into your WordPress site’s admin area, then click on Settings > General in the main menu. The WordPress Address (URL) and Site Address (URL) fields should no longer be greyed out, but restored to normal and editable once again …

WordPress Address (URL) and Site Address (URL) fields are no longer greyed out

(WordPress Address (URL) and Site Address (URL) fields are no longer greyed out)

Info

The above should fix this issue in most instances. If you are still experiencing issues with greyed out URLs, contact your website developer or hosting company for help.

Congratulations! Now you know how to fix the issue of greyed out URLs preventing you from changing your WordPress site address URLs in the General Settings section.

How To Fix Can't Change WordPress Website Address - Greyed Out URLs

More WordPress Troubleshooting Tutorials

If you experience other problems or errors with WordPress, refer to the tutorials in the section below:

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***

Using Post Categories To Improve WordPress SEO, User Navigation & Content Layout

Learn how to improve SEO, user navigation, and the content layout of your website or blog using post categories …

Using Post Categories To Improve WordPress SEO, User Navigation & Content Layout

WordPress post categories help keep your website and your content organized, boost your search engine rankings, and make it easier for site visitors to find what they are looking for.

WordPress post categories can also be used to improve your content layout.

In this tutorial, we’ll look at ways to improve SEO, user navigation, and the content layout of your website or blog using post categories.

Info

For a detailed step-by-step tutorial on WordPress post categories and how to set up and use categories in your posts, see the tutorial below:

Improve WordPress SEO, User Navigation & Content Layout With Post Categories

Categories are normally assigned to WordPress Posts, not Pages , so we’ll focus on posts in this tutorial (if you are unsure about the difference between posts and pages, see our tutorial on WordPress Posts Vs WordPress Pages).

Tip

If you need to add categories (and tags) to your WordPress pages, you can install a plugin like Post Tags and Categories For Pages.

Planning Your Categories

Even though WordPress is flexible enough to let you add new categories ‘on the fly,’ if you don’t plan your categories (and subcategories) properly, you will find it harder to keep your site organized and manageable as more content gets added to your site.

If you need help planning your website, your content, or your categories, see our website planning tutorials and our guide on keeping your website manageable and organized.

Improving WordPress SEO With Post Categories

The simplest and easiest way to improve WordPress SEO with post categories is to:

  1. Set up permalinks to include categories, and
  2. Install and configure an SEO plugin like Yoast SEO

Include Categories In Your Permalinks

Permalinks are a feature of WordPress that lets you set up search-engine friendly URLS (for more details, see our tutorial on how to set up and use WordPress permalinks).

When configuring your permalinks, all you need to do is make sure that post categories are included in the URLs …

Include categories in your permalinks

(Include categories in your permalinks)

This will automatically display search-engine friendly URLs with your categories (and subcategories) and post title keywords …

Search-engine friendly URLs with categories and subcategories included

(Search-engine friendly URLs with categories and subcategories included)

Use An SEO Plugin

Installing an SEO plugin like Yoast SEO will not only improve the SEO of your content, it also lets you optimize your post categories, category archive pages, etc. …

Optimize your post categories with an SEO plugin

(Optimize your post categories with an SEO plugin)

Adding category descriptions will display on some WordPress themes and can help to boost your content’s SEO …

Category descriptions can help boost your content's SEO

(Category descriptions can help boost your content’s SEO)

Once your permalinks and SEO plugin settings are configured for your post categories, WordPress will then automatically start delivering you the SEO benefits of search engine-friendly URLs and better content indexing.

Improving User Navigation With Post Categories

Post categories can be used to improve user navigation on your WordPress site in different pages and different sections of your site, on site maps, menus, sidebar widgets, archive pages, even different RSS feeds.

Here, for example, are some of the ways you can help users navigate your content using post categories …

Categories Widget

Adding a categories widget to your sidebar lets users find related content assigned to a category …

Add a categories widget to your sidebar

(Add a categories widget to your sidebar)

When users click on a category link on the categories widget, they are taken to a category archive page.

Category Archive Pages

Category archive pages group together all posts assigned to a category …

Category archive page

(Category archive page)

Breadcrumb Navigation Links

Breadcrumb navigation links display on some WordPress themes.  Displaying categories in breadcrumb navigation links not only helps to improve user navigation, but also SEO …

(Display categories in breadcrumb navigation links)

Clicking on the category section of the breadcrumb link will take users to the category archive page.

Info

If you use the Yoast SEO plugin and your WordPress theme does not support breadcrumb navigation links by default, you (or your website developer) will either need to edit your theme’s templates and add a snippet of code to display breadcrumbs, or choose a WordPress theme that supports features like breadcrumb navigation links (e.g. the Avada theme) …

Themes like Avada support breadcrumbs

(Themes like Avada support breadcrumbs)

Improving WordPress Content Layout With Post Categories

Post categories and subcategories can be used to help organize and improve the layout of your content.

For example, WPCompendium.org’s WordPress tutorials are organized into the main categories below:

If you click any of the above links, you will see pages displaying a list of tutorials for each category organized in a grid view layout …

List of posts grouped by category

(List of posts grouped by category)

Some sections, like our WordPress Plugin Tutorials, display a list of post sections grouped by subcategories …

List of post sections grouped by subcategory

(List of post sections grouped by subcategory)

Clicking on an item in the ‘WordPress Plugin Tutorials’ page will take you to a page displaying all the tutorials grouped under one of its subcategories, such as:

We use post categories and subcategories to organize, filter, and display content on WP Compendium’s tutorial sections using a premium plugin called Content Views Pro.

The plugin also has a free version, called Content Views.

Content Views

Content Views - Post Grid & List for WordPress

(Content Views – Post Grid & List for WordPress)

Content Views is a free WordPress plugin that lets you organize, filter, sort, and display content from selected posts, pages, or custom post types using different views and layouts (e.g. grid, table, list) and insert these views anywhere on your site using a shortcode …

Use categories to display posts using different layouts

(Use categories to display posts using different layouts)

The plugin is very easy to use and lets you create unlimited custom views and layouts without touching code.

The free version of the plugin provides 3 basic layouts (Grid, Collapsible list, Scrollable list). The comprehensive premium version (Content Views Pro) provides the basic layouts and a whole lot more, including many advanced features  …

Display your content using different views and layouts with the Content Views Pro plugin

(Display your content using different views and layouts with the Content Views Pro plugin)

Although this tutorial focuses mostly on post categories, with Content Views Pro installed, you can create different views using posts, pages, and custom post types and filter these using a combination of different criteria including post categories, tags, publish date, post author, keywords, and custom fields.

You can also sort and organize your content using a wide range of methods, including post or page IDs, published date, modified date, drag & drop, post slug, comment count, menu order, custom fields, and even random sort (content displays in random order every time the page is refreshed) …

Create customized views to display content on your WordPress site

(Create customized views to display content on your WordPress site)

Views are created by selecting different options in the view-building form …

Create different content views by selecting options

(Create different content views by selecting options)

You can live preview your content as you build or edit your views …

Preview as you build

(Preview as you build)

After creating and saving your views, the plugin generates a shortcode which you can use to insert into your posts, pages, widgets, etc. …

Use shortcodes to insert views into your content

(Use shortcodes to insert views into your content)

The Content Views or Content Views PRO plugin gives you complete control over how your content is grouped and displayed to visitors. Views are 100% mobile responsive and the plugin is optimized to help improve SEO.

Tip

You can also use the Content Views plugin to add an attractive site map for your visitors with post thumbnail images and descriptions. To learn more, go here:

For more details about using the plugin, check out the video below, visit the FREE version plugin page here, or check out the Content Views Pro website for a full list of features, comprehensive demo site, plugin pricing and FAQ section, and more.

(Overview of WordPress Content Views)

We hope that you have found the above information useful. Feel free to check out the tutorials on the demo view below …

Webinar JEO - Webinar Software

Grow Your Business Online With Webinars

Learn how to grow your business online with webinars and a professional webinar software that lets you run unlimited webinars for unlimited attendees ...
How To Research Keywords For SEO Content

How To Research Keywords For SEO Content

Learn how to do effective keyword research and improve your content SEO in this step-by-step tutorial ...
WPCompendium WordPress Tutorials Chrome Extension

WordPress Tutorials Free Chrome Extension

Install WPCompendium's WordPress Tutorials extension for Google Chrome browsers and access our FREE WordPress tutorials with one-click! ...
RoboForm - Password Management Tool

RoboForm – Password Management Tool

RoboForm is a powerful password management tool that lets you easily store all of your login passwords and generate secure passwords ...
How To Store, Plan And Organize Your Content Ideas

How To Store, Plan And Organize Your Content Ideas

Here is a simple, inexpensive, and effective system you can use to store, plan, and organize your content ideas ...
Loading...

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***