Version Description
- First public release.
=
Download this release
Release Info
Developer | solarissmoke |
Plugin | Disable Feeds |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- disable-feeds.php +42 -0
- readme.txt +31 -0
disable-feeds.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Disable Feeds
|
4 |
+
Plugin URI: http://wordpress.org/extend/plugins/disable-feeds/
|
5 |
+
Description: Disable all RSS/Atom feeds on your WordPress site.
|
6 |
+
Version: 1.0
|
7 |
+
Author: Samir Shah
|
8 |
+
Author URI: http://rayofsolaris.net/
|
9 |
+
License: GPLv2 or later
|
10 |
+
*/
|
11 |
+
|
12 |
+
if( !defined( 'ABSPATH' ) )
|
13 |
+
exit;
|
14 |
+
|
15 |
+
class Disable_Feeds {
|
16 |
+
function __construct() {
|
17 |
+
if( ! is_admin() ) {
|
18 |
+
add_action( 'wp_loaded', array( $this, 'remove_links' ) );
|
19 |
+
add_filter( 'template_redirect', array( $this, 'filter_query' ), 9 ); // before redirect_canonical
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
function remove_links() {
|
24 |
+
remove_action( 'wp_head', 'feed_links', 2 );
|
25 |
+
remove_action( 'wp_head', 'feed_links_extra', 3 );
|
26 |
+
}
|
27 |
+
|
28 |
+
function filter_query() {
|
29 |
+
if( !is_feed() )
|
30 |
+
return;
|
31 |
+
|
32 |
+
if( isset( $_GET['feed'] ) ) {
|
33 |
+
wp_redirect( remove_query_arg( 'feed' ), 301 );
|
34 |
+
exit;
|
35 |
+
}
|
36 |
+
|
37 |
+
set_query_var( 'feed', '' );
|
38 |
+
// redirect_canonical will do the rest
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
new Disable_Feeds();
|
readme.txt
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Disable Feeds ===
|
2 |
+
Contributors: solarissmoke
|
3 |
+
Tags: disable, rss, atom, rdf, feeds
|
4 |
+
Requires at least: 3.2
|
5 |
+
Tested up to: 3.5
|
6 |
+
Stable tag: trunk
|
7 |
+
|
8 |
+
Disables all RSS/Atom/RDF feeds on your WordPress site.
|
9 |
+
|
10 |
+
== Description ==
|
11 |
+
|
12 |
+
This plugin disables all RSS/Atom/RDF feeds on your site. It is useful if you use WordPress purely as a content management system (and not for blogging). All requests for feeds will be redirected to the corresponding HTML content.
|
13 |
+
|
14 |
+
If you come across any bugs or have suggestions, please use the plugin support forum or [email me](http://rayofsolaris.net/contact/). I can't fix it if I don't know it's broken! Please check the [FAQ](http://wordpress.org/extend/plugins/disable-feeds/faq/) for common issues.
|
15 |
+
|
16 |
+
== Frequently Asked Questions ==
|
17 |
+
|
18 |
+
= Why should I disable feeds? =
|
19 |
+
|
20 |
+
Feeds are useful if you have regularly updated content (blog posts, comments) on your site, and you want people to be able to subscribe to those updates. If you have static pages, then they aren't, and just add overhead to your site.
|
21 |
+
|
22 |
+
== Changelog ==
|
23 |
+
|
24 |
+
= 1.0 =
|
25 |
+
* First public release.
|
26 |
+
|
27 |
+
== Installation ==
|
28 |
+
|
29 |
+
1. Upload the plugin folder to the `/wp-content/plugins/` directory
|
30 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
31 |
+
3. That's it. All feeds are now disabled (and any requests for a feed will be redirected back to the parent content).
|