How to disable ?tp=1 in Joomla

Written by on January 27, 2010 in Core tips - 8 Comments

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.

About the Author

Matthew King is the excessively caffeinated head of customer service and system administrator for JoomlaJunkie. He loves paintball and dry humor. Matt also sells web hosting and does website design at ColumbusGEEK.com. He is based in Columbus, Ohio (USA).

8 Comments on "How to disable ?tp=1 in Joomla"

  1. Andrew April 3, 2010 at 3:13 am · Reply

    Thanks, it works!!
    =D
    .-= Andrew´s last blog ..Teste =-.

  2. magj November 7, 2010 at 6:36 am · Reply

    Hi
    Is the htaccess modification compatible with sef url’s?

    Thanks and regards

  3. vijith July 20, 2011 at 7:00 am · Reply

    Thanks a lot ….
    What about the security option in joomla sites?

Trackbacks for this post

  1. View module positions on a Joomla site with ?tp=1 | Joomla Tips
  2. Tweets that mention How to disable ?tp=1 in Joomla | Joomla Tips -- Topsy.com
  3. Where is that Joomla module published? 3 simple ways to find out. | ProThemer Team Blog
  4. View module positions on a Joomla site with ?tp=1 | ColumbusGEEK aka Matt King | Website design, hosting and marketing.
  5. how to disable tp=1 in joomla « MahastMahast

Leave a Comment