AI Verified

Name

Disable RSS Feeds - WPCode

Language

PHP

Rating

Voted: 0 by 0 user(s)

Link for further information:

The author has provided the following URL that may be helpful to setting up or using this snippet:

https://www.cryptocurrency-faq.com/

Codevault

yinliang

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.3

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Snippet Source:

https://www.cryptocurrency-faq.com/

History

Last modified:

12/06/2024

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Disable RSS Feeds - WPCode

 
                    
1/**
2 * Display a custom message instead of the RSS Feeds.
3 *
4 * @return void
5 */
6function wpcode_snippet_disable_feed() {
7 wp_die(
8 sprintf(
9 // Translators: Placeholders for the homepage link.
10 esc_html__( 'No feed available, please visit our %1$shomepage%2$s!' ),
11 ' <a href="' . esc_url( home_url( '/' ) ) . '">',
12 '</a>'
13 )
14 );
15}
16 
17// Replace all feeds with the message above.
18add_action( 'do_feed_rdf', 'wpcode_snippet_disable_feed', 1 );
19add_action( 'do_feed_rss', 'wpcode_snippet_disable_feed', 1 );
20add_action( 'do_feed_rss2', 'wpcode_snippet_disable_feed', 1 );
21add_action( 'do_feed_atom', 'wpcode_snippet_disable_feed', 1 );
22add_action( 'do_feed_rss2_comments', 'wpcode_snippet_disable_feed', 1 );
23add_action( 'do_feed_atom_comments', 'wpcode_snippet_disable_feed', 1 );
24// Remove links to feed from the header.
25remove_action( 'wp_head', 'feed_links_extra', 3 );
26remove_action( 'wp_head', 'feed_links', 2 );

0

Related Snippets

Please see some snippets below related to this snippet..

General

AI Verified

0

Custom WordPress Image Sizes

Added: 1 year ago

Last Updated: 1 year ago

A snippet for custom WordPress image sizes

General

Unverified

0

Reduce Wordpress Revisions To 3

Added: 5 months ago

Last Updated: 4 months ago

General

AI Verified

0

Custom Wordpress Register by User with Shortcode

Added: 1 year ago

Last Updated: 1 year ago

This script allows you to create an advanced and customizable registration form for your WordPress website. It includes fields for entering first name, last name, and email address, with the email add...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

General

AI Verified

0

Disable WordPress REST API - WPCode

Added: 2 weeks ago

Last Updated: 2 weeks ago

General

AI Verified

0

Disable RSS Feeds - WPCode

Added: 2 weeks ago

Last Updated: 2 weeks ago