How to disable ?tp=1 in Joomla

Written by Matt on 27 January 2010

Topics: Core tips

We covered how to show your published module positions using ?tp=1 in a previous post.

Now, a few weeks have passed and for some reason you are hyper paranoid and want to know how to hide it.  My first thought is to tell you that there are far more important things to be worrying about, but to each his own.  *shrugs*

The easiest way is to add this to your Joomla .htaccess file.

##### Start ?tp=1 prevention ######
RewriteCond %{QUERY_STRING} tp=(.*)
RewriteRule ^(.*)$ index.php [F,L]
##### End ?tp=1 prevention ######

You may need to change it from htaccess.txt to .htaccess first.  If your site goes down after changing the file name or has odd behaviors it’s time for you to do some reading on what .htaccess is and how to use it.  This article has a lot of good info on the file and it’s proper usage.

I have heard about the previous method not working well for everybody in all situations.   Maybe you don’t want to use SEO urls.  Maybe you don’t want to read about htaccess and it’s proper usage.  You can always use this plugin on Joomla.org. I have no personal experience with it, but it seems pretty straight forward.

A third alternative is to do a core hack.

Go to /libraries/joomla/application/module/helper.php and look around line 200 for this code.

//dynamically add outline style
if(JRequest::getBool('tp')) {
$attribs['style'] .= ' outline';
}

Comment out the 3rd line out with //

//dynamically add outline style
if(JRequest::getBool('tp')) {
//$attribs['style'] .= ' outline';
}

Keep in mind this is a core hack. If you upgrade or patch your Joomla install, this hack will get deleted.

Finally, if all this code confuses you or is a hassle, you might want to try out Morph from JoomlaJunkie. This feature, as well as hundreds of other tweaks are built right into it.

This tip was inspired by a Tumblr post I read here. It has 2 other ways to disable ?tp=1 if you want other options.

Get notified about new tips & tricks for Joomla:

RSS

Click here to subscribe via RSS feed


subscribe

Click here to receive updates via email

    Related Posts

    No related posts.

1 Comments For This Post I'd Love to Hear Yours!

  1. Andrew Says:

    Thanks, it works!!
    =D
    Andrew´s last blog ..Teste My ComLuv Profile

2 Trackbacks For This Post

  1. View module positions on a Joomla site with ?tp=1 | Joomla Tips Says:

    [...] the sites javascript.  Pretty cool stuff. Want to disable this functionality for some reason?  Check out this post. Tip this to TechMemeDigg this!Share this on RedditStumble upon something good? Share it on [...]

  2. Tweets that mention How to disable ?tp=1 in Joomla | Joomla Tips -- Topsy.com Says:

    [...] This post was mentioned on Twitter by Saurabh Shah and Joomla Tips, Pete Coutts. Pete Coutts said: RT @JoomlaTips: New #joomla tips: How to disable ?tp=1 in Joomla http://bit.ly/bj0A9E [...]

Leave a Comment Here's Your Chance to Be Heard!

CommentLuv Enabled

Subscribe without commenting