- Posts: 5
COMMUNITY FORUM
Completely disable RSS?
- Darryll
-
Topic Author
- Offline
- New Member
Less
More
15 years 1 month ago #80902
by Darryll
Completely disable RSS? was created by Darryll
Hi folks,Small time lurker, first time poster.This might be a post for the main Joomla forum but I'd like to keep the edits just to K2 if possible.What I'm wanting to do is remove the RSS feeds from a particular category, and I'm open to removing it completely from K2 or even the site if necessary.I've removed the RSS button from the category options, but the RSS icon is still visible in the browsers address bar. And even if I find a way to remove this I'm guessing that the RSS URL is still valid, as this is the case when you remove the RSS feed links in the core Joomla setup.Why I might need to do this is something that's probably best explained in a different thread, just wondered if there's an option somewhere I've missed.I'm hoping to avoid core hacks where possible, but if it comes down to that then hey, what can you do?I have a nice big thanks sat on my desk if anyone's got any info on this.Cheers even if you don't.Sorry if I rambled, been a long day.Ta,Darryll
Please Log in or Create an account to join the conversation.
- Darryll
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
15 years 1 month ago #80903
by Darryll
Replied by Darryll on topic Completely disable RSS?
update:
Looks like things have changed and I'll need to disable the RSS for the whole site, so I've gone a rather basic hack.
Edited rss.php and atom.php from the libraries\joomla\document\feed\renderer folder, changed line16 to:
defined('JPATH_BASE_FAIL') or die();
Now the RSS and Atom feeds both show blank pages, which isn't as clean as I'd like but it does achieve I guess...
Thought I'd post this so the thread isn't still waiting for info.
Thanks,
Darryll
Looks like things have changed and I'll need to disable the RSS for the whole site, so I've gone a rather basic hack.
Edited rss.php and atom.php from the libraries\joomla\document\feed\renderer folder, changed line16 to:
defined('JPATH_BASE_FAIL') or die();
Now the RSS and Atom feeds both show blank pages, which isn't as clean as I'd like but it does achieve I guess...
Thought I'd post this so the thread isn't still waiting for info.
Thanks,
Darryll
Please Log in or Create an account to join the conversation.
- daumayr
-
- Offline
- New Member
Less
More
- Posts: 1
14 years 8 months ago #80904
by daumayr
Replied by daumayr on topic Completely disable RSS?
Hi Darryll,
I had to face the same task, namely removing any RSS and Atom Feed Links from a whole Joomla site.
Changing the Properties for the Frontpage menu item didn't remove it in my case, so I had to find a workaround.
I found your solution via Google, but in my case I couldn't change core Joomla files. Finally I found a solution, and it works as follows:
In my template (index.php), I replaced the with the following customization of the head-Output:
# NOTE same as
# NOTE removes Feed-links from header
# NOTE changed < and > to [ and ], so the K2 Commenting System won't remove the links
$doc =& JFactory::getDocument();
$buffer = $doc->getBuffer('head');
$buffer = str_replace('[link href="/de.feed?type=rss" rel="alternate" type="application/rss+xml" title="RSS 2.0" /]', '', $buffer);
$buffer = str_replace('[link href="/de.feed?type=atom" rel="alternate" type="application/atom+xml" title="Atom 1.0" /]', '', $buffer);
echo $buffer;
As you can see, I manually replaced the feed-Links with an empty string. This is kind of brutally altering the HTML code of the head-Output, but it really works nicely and I didn't have to hack any core Joomla files.
The Links may vary, depending on the Joomla configuration.
- Dominik
I had to face the same task, namely removing any RSS and Atom Feed Links from a whole Joomla site.
Changing the Properties for the Frontpage menu item didn't remove it in my case, so I had to find a workaround.
I found your solution via Google, but in my case I couldn't change core Joomla files. Finally I found a solution, and it works as follows:
In my template (index.php), I replaced the with the following customization of the head-Output:
# NOTE same as
# NOTE removes Feed-links from header
# NOTE changed < and > to [ and ], so the K2 Commenting System won't remove the links
$doc =& JFactory::getDocument();
$buffer = $doc->getBuffer('head');
$buffer = str_replace('[link href="/de.feed?type=rss" rel="alternate" type="application/rss+xml" title="RSS 2.0" /]', '', $buffer);
$buffer = str_replace('[link href="/de.feed?type=atom" rel="alternate" type="application/atom+xml" title="Atom 1.0" /]', '', $buffer);
echo $buffer;
As you can see, I manually replaced the feed-Links with an empty string. This is kind of brutally altering the HTML code of the head-Output, but it really works nicely and I didn't have to hack any core Joomla files.
The Links may vary, depending on the Joomla configuration.
- Dominik
Please Log in or Create an account to join the conversation.
- jason bradley
-
- Offline
- New Member
Less
More
- Posts: 5
14 years 1 month ago #80905
by jason bradley
Replied by jason bradley on topic Completely disable RSS?
Any updates to this thread with a more graceful solution to disabling the rss feeds using Joomla 1.5.22 and K2 2.4.1?
Please Log in or Create an account to join the conversation.
- Lianos Andreas
-
- Offline
- New Member
Less
More
- Posts: 2
13 years 11 months ago #80906
by Lianos Andreas
Replied by Lianos Andreas on topic Completely disable RSS?
can someone shed some light how to disable the rss button at first place?
Cheers
Cheers
Please Log in or Create an account to join the conversation.