I searched the forum and didn't find a direct answer for this.

I would like to remove the welcome message without promoting anything to the home page. I wouldn't like to install views or use front_page or any other module. I would just like to know where can i comment out or remove the code (probably if condition) that causes drupal to display this message.

Thanks

Comments

Rowanw’s picture

Create any type of content, then go to Administer > Site configuration > Site information, and set the front page to "node/1".

ilo’s picture

That content is hardcoded in node.module when there's no any promoted node. IF you don't want to promote, than you will have to edit the node.module file.

Chi Loop’s picture

Thanks Ilo. It worked!

For the rest who might ever face this problem with what part is to be edited, open node.module and search for the function node_page_default().

I replaced:

/**
 * Menu callback; Generate a listing of promoted nodes.
 */
function node_page_default() {

  $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));

  if (db_num_rows($result)) {
    $feed_url = url('rss.xml', NULL, NULL, TRUE);
    drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') .' '. t('RSS'));

    $output = '';
    while ($node = db_fetch_object($result)) {
      $output .= node_view(node_load($node->nid), 1);
    }
    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
  }
  else {
    // Check for existence of admin account.
    $admin = db_result(db_query('SELECT uid FROM {users} WHERE uid = 1'));

    $default_message = t('<h1 class="title">Welcome to your new Drupal website!</h1><p>Please follow these steps to set up and start using your website:</p>');
    $default_message .= '<ol>';

    if (!$admin) {
      $default_message .= '<li>'. t('<strong>Create your administrator account</strong> To begin, <a href="@register">create the first account</a>. This account will have full administration rights and will allow you to configure your website.', array('@register' => url('user/register'))) .'</li>';
    }
    $default_message .= '<li>'. t('<strong>Configure your website</strong> Once logged in, visit the <a href="@admin">administration section</a>, where you can <a href="@config">customize and configure</a> all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) .'</li>';
    $default_message .= '<li>'. t('<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) .'</li>';
    $default_message .= '<li>'. t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) .'</li>';
    $default_message .= '<li>'. t('<strong>Start posting content</strong> Finally, you can <a href="@content">create content</a> for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) .'</li>';
    $default_message .= '</ol>';
    $default_message .= '<p>'. t('For more information, please refer to the <a href="@help">help section</a>, or the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a>, or view the wide range of <a href="@support">other support options</a> available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) .'</p>';

    $output = '<div id="first-time">'. $default_message .'</div>';
  }
  drupal_set_title('');

  return $output;
}

with

/**
 * Menu callback; Generate a listing of promoted nodes.
 */
function node_page_default() {

  $result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));

  if (db_num_rows($result)) {
    $feed_url = url('rss.xml', NULL, NULL, TRUE);
    drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') .' '. t('RSS'));

    $output = '';
    while ($node = db_fetch_object($result)) {
      $output .= node_view(node_load($node->nid), 1);
    }
    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
  }

  else {
   // Check for existence of admin account.
    $admin = db_result(db_query('SELECT uid FROM {users} WHERE uid = 1'));

 /**
 *       $default_message = t('<h1 class="title">Welcome to your new Drupal website!</h1><p>Please follow these steps to set up and start using your website:</p>');

    $default_message .= '<ol>';

          if (!$admin) {
      $default_message .= '<li>'. t('<strong>Create your administrator account</strong> To begin, <a href="@register">create the first account</a>. This account will have full administration rights and will allow you to configure your website.', array('@register' => url('user/register'))) .'</li>';
    }
    $default_message .= '<li>'. t('<strong>Configure your website</strong> Once logged in, visit the <a href="@admin">administration section</a>, where you can <a href="@config">customize and configure</a> all aspects of your website.', array('@admin' => url('admin'), '@config' => url('admin/settings'))) .'</li>';
    $default_message .= '<li>'. t('<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.', array('@modules' => url('admin/build/modules'), '@download_modules' => 'http://drupal.org/project/modules')) .'</li>';
    $default_message .= '<li>'. t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.', array('@themes' => url('admin/build/themes'), '@download_themes' => 'http://drupal.org/project/themes')) .'</li>';
    $default_message .= '<li>'. t('<strong>Start posting content</strong> Finally, you can <a href="@content">create content</a> for your website. This message will disappear once you have promoted a post to the front page.', array('@content' => url('node/add'))) .'</li>';
	
	
    $default_message .= '</ol>';

    $default_message .= '<p>'. t('For more information, please refer to the <a href="@help">help section</a>, or the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a>, or view the wide range of <a href="@support">other support options</a> available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) .'</p>';
*/	
   $output = '<div id="first-time">'. $default_message .'</div>'; 
  }
  drupal_set_title('');

  return $output;
} 

Maybe there is a better way to comment this code out or something, if so, do reply telling how to do so for the benefit of all. This worked for me. Cheers (and thanks Ilo)

ilo’s picture

you can't modify the code, and don't want to promote a node to the front page, there's also another option when the locale module is enabled. You may translate the text of this page to empty strings, so when it gets rendered you can show a blank page when a user reaches the default page.

radiofranky2009’s picture

in "node.module" line 1751

"$output = ' ';
$num_rows = false < == change this to "true"
the default message will be gone for good but again, everytime you upgrade your core you need to edit this portion.

cheers,
s

Pronco’s picture

Hello,

Changing the value from false to true works for me. However, this modification should be rolled-back whenever I am doing an in-place upgrade.

Thank you.

vallab444’s picture

Hi, Chi Loop

I tried this, and ended up with:

Parse error: syntax error, unexpected T_CASE in /var/www/domains/medianewday.com/docs/modules/node/node.module on line 78

Fatal error: Call to undefined function node_get_types() in /var/www/domains/medianewday.com/docs/includes/theme.inc on line 923

where could I've gone wrong?

cheers

-Vallab

dman’s picture

What you are doing wrong is hacking core.
Don't do that unless you are a PHP expert.
And a PHP expert would know that you don't hack core.

The suggested change here is BAD and also quite probably out-of-date with the current version of Drupal.

Rowanw’s picture

Don't modify core files for something so trivial, every time you upgrade you will have to make the change again. The more you hack core files the harder it will be to upgrade and apply patches.

If you don't want to have a front page list of nodes, then change the front page to "node/1" (or any node you like) instead of "node". This will make your front page use an existing node you've created instead of showing a list of nodes (or the welcome text).

If you do want to promote nodes to the front page then the welcome text will be replaced as soon as you promote your first node.

sepeck’s picture

The contrib module front page can also help with this.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Chi Loop’s picture

I didn't think of that Rowanw. It makes absolute sense. I'm going to uncomment the changes in node.module and change the front page to node/x as you say and also check out the front_page module.

NancyDru’s picture

Then why do I have a site where one role is getting the "Welcome to your new Drupal site!" even when there are 3 nodes promoted and showing first? This does not happen on the user/1 account, or other roles, just the role for the board of directors.

One strange thing I see is that I have the post settings set to display up to 10 nodes on the front page. There are only 3 promoted at the moment. The default "Welcome" page is showing as page 2. Could this be a pager_query or db_rewrite_sql bug?

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

JogaLuce’s picture

if the users still getting the default text don't have access clearance to the promoted nodes that could be why. i think. maybe.

NancyDru’s picture

I got around this by deleting the entries in node_access and adding them to the "all" realm. The problem went away after that. However, if anyone ever comes back in and rebuilds permissions, it will have to be done again.

bc173’s picture

As today, I'm still experiencing this problem (Drupal 5.2).

I've been using the CCK and Views modules to setup my site. Three blocks appear on the frontpage but the welcome message is still there.

Things I've done:
- Checked whether anonymous users have permissions to access content.
- Cleaned up the node_access table (as described at http://drupal.org/node/64114).

But none of these things work.

Some side questions:
- Why should I promote a node to the frontpage if all my content is organised in blocks?

Thanks for any help.

VM’s picture

seems to me, that instead of orgainizing your content in sidebar blocks, you should use the panels.module so that you can add blocks to the content area ?

a bit of a trick would be to create a node, with a 1x1 pixel image on the node, and setting this node to be the home page in administer -> site information, doing so will put a node on the front page that is essentially blank and as such will allow you to run your blocks in side bars without promoting anything to the front page.

NancyDru’s picture

That's a good tip, VM.

If you read my post above, you'll see that, in my case, there are three nodes promoted and I still get the welcome page for one role. Any ideas?

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

VM’s picture

My first guess would be the node access table being out of whack. Though I know you are drupalized enough to have checked that, so mentioning it seems fruitless. I"ve never seen a situation in my own installs where the problem was for a "role" other then anon. Will keep your problem rolling around my mind for a bit and see if I can think of something while waiting for todays NFL games to begin.

E-A-G-L-E-S .... EAGLES!

NancyDru’s picture

Yes, I checked it and it looks okay to me. I have been to chicken, though, to rebuild permissions. I guess I need to get over that.

The Sitedoc access check says everything is reasonable, but I have to believe that it is something like you say.

This is certainly a first for me. I've never seen this happen for any roles once I built a front page. But it's also the first time I've used Taxonomy Access Control too.

VM’s picture

And I assume you have combed over the TAC settings ?

NancyDru’s picture

Yes, I have, although I can't see any reason why they would cause this. I've also gone through the node module code and can't see how this could even happen.

I did just now rebuild permissions and it makes no difference.

It's almost acting like the node module is getting called twice; the first time correctly building the front page, then the second time creating the Welcome page. But that doesn't make sense either. And yes, I did stick some debugging code into the node module but it hasn't shed any real light on the problem.

Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database

hesolares’s picture

I have the same problem Nancy. This never happened before. This is also the first time I used the Taxonomy Access module. Something must have happened when the install modified the database. If you come up with some kind of answer, please let us know.

bc173’s picture

I'm not running the Taxonomy Access module and I'm also having this problem. So I think you can't blame this module.

Yesterday, I did a fresh Drupal 5.2 install and installed the following modules:

- CCK
- Link
- Pathauto
- Token
- Views
- Imagefield

- Feedburner
- Flickr
- Google Analytics
- Keys_api

But I'm sure Feedburner, Flickr, Google Analytics and Keys_api have nothing to do with it because I had the problem before installing these modules.

NancyDru’s picture

The site I'm having this on is a fairly simple one. The only common module I can see is Views.

bc173’s picture

It's just because there are no nodes promoted to the frontpage.

Once you promote a node, it's solved. You could create a simple content type (with only a title, which is required) and insert one piece of content which you promote. Then with CSS or a custom template you could hide this node. Ugly solution, but it works.

I'm still waiting for a better solution...

NancyDru’s picture

All of my sites have something promoted to the front page. This one having the problem has three nodes promoted. They show as one would expect, but then it shows the pager, and the welcome page is page 2.

hesolares’s picture

I already promoted three stories to the front page and users with authenticated or anonymous roles still see the default welcome page. Administrative roles have no problem seeing the promoted content in the front page. The problem is somehow related to users within certain roles only, even when they have access to content.

bc173’s picture

Still no answer to this issue... And it seems many people deal with it...

To be honest I'm a bit disappointed in the Drupal support on this forum. I know I can't blame anyone, but I wonder why it's so hard to get quick and appropriate answers to your questions.

VM’s picture

@ bc173: With regards to your idea of a better solution ? have you tried the frontpage.module? There is a specific reason that the drupal welcome message is in place. Especially for new users. Because it isn't a page, it can't just be shut off. You must work around it using one of the methods outlined in the handbook ( http://drupal.org/node/140751 ) and in this thread. You've even coughed up one of your own. Though, I don't see why you would need a custom content type, you could simply add a node as the default front page in administer -> site settings -> default front page. then use css to hide the node title. This is a known method and it works quite well without alot of fuss and one css declaration addition.

Keep in mind too: The forums are volunteer, you have alternative ways to gain answers, including but not limited to hiring a consultant and jumping into the IRC support channel. Being "disappointed" in people who are trying to help simply because they haven't provided an answer "you like" doesn't necessarily mean you didn't get an answer.

NancyDru’s picture

VM, I think you know I know about these solutions. I've never had this problem before, but I am now. This is the first site I've done that uses TAC and the problem is only showing up for one role, even though the front page is open to everyone, including anonymous users. I don't see anything in the TAC settings that looks unusual. The fact that it is being put on a second page even though the first page is not totally full baffles me.

VM’s picture

I know. I wasn't addressing your situtation. Try as I may, I can't reproduce your situation either, Though I have not gone as far as to install TAC on any sites to try and reproduce. By chance have you tried to reproduce on a test installation replicating the site you are having a problem with?

This thread seems to have gone in two totally seperate directions with two different issues from what I can tell. Those who just don't want the Drupal welcome page, or want to avoid it without promoting nodes to the front page and those who are getting the welcome page when they shouldn't be as you are.

NancyDru’s picture

No, since I don't own the site, it is difficult for me to get a backup to load into a test site. And it's too big to try to cut and paste. If I get a few spare minutes, I may try to reproduce just the front page and TAC settings.

VM’s picture

: ) I meant just a test site, not a complete duplicate just another site (test) with TAC. Could be something elusive with that module.

Another thing that has just crossed my mind, the role that is problematic, what if you edited/altered the name of that role? problem still there?

NancyDru’s picture

No, I haven't tried changing the name. I'll try to do that today. Maybe I can set up a test site with just the front page.

ilo’s picture

-----
To be honest I'm a bit disappointed in the Drupal support on this forum. I know I can't blame anyone, but I wonder why it's so hard to get quick and appropriate answers to your questions.
------

I'm impressed with this kind of answer. After several replies telling about how to remove the front page information, you still claim there's no help in the forums..

Let's start again, if you want.. Here's my help, start a new fresh drupal setup, untill you recongnize wich of the modules is breaking the permissions, and then maybe we can add a workaround, but I guess it's impossible from your post situation with several modules and I guess some configuration settings yo give a solution, neither more help than what was done. Even if we decided to try to reproduce to really understand where the problem is, we still don't know what your configuration is, so we can reach another errors instead of helping you.

Anyway, the main purpose of the initial page, the front page, is to show a welcome message for a blank content view. If you have set your content in blocks or categories, what do you expect to appear in a front page? and how do you expect drupal deals with that? You are telling not to promote a node as they are categorized, then.. what must be shown in the front page of your site?

I wonder why some people forgets to thank the others effort, You have turned crazy to MisUnderstood but haven't said any word about spending his time with you. I could be a bit dissapointed also with some people comming to drupal and requesting help withouth first doing a search in the site, but I would never say a word about it :)

(Better if I stop before looking like a trol.. :D )

NancyDru’s picture

UPDATE node_access SET gid=0, realm='all' WHERE nid IN (3, 4, 5) AND gid=1;
DELETE FROM node_access WHERE nid IN (3, 4, 5) AND gid>1;

Nodes 3, 4, and 5 are my promoted nodes.

@bc173: A big part of this is because of the wide variety of ways in which a site may be implemented with Drupal. I'm fairly certain this is a case of shooting myself in the foot (with TAC), but I have no idea where the trigger is.

greenSkin’s picture

Just create a custom front page for your theme. Create file 'page-front.tpl.php' in your theme directory with the code to generate your desired output. Easiest way is to copy 'page.tpl.php' and remove code that generates the welcome text.

snowball43’s picture

If you are using the PHPTemplate engine.

housemd’s picture

subscribing

OldAccount’s picture

Creating page-front.tpl.php alone did not remove the welcome message, I had to remove:

<div id="content-area">
          <?php print $content; ?>
</div>

...and just use my own regions. Not sure how else to do it, I couldn't figure out where the welcome message was coming from, it's not in page-front.tpl.php.

NancyDru’s picture

It usually comes from node.module.

Sparky Marky’s picture

I did this and it seems to work, Drupal 5.2, PHP5

create a node with php code

<?php
header("Location: ?q=node/1");
?>

Make it so that it is promoted to the front page, so when Drupal calls that it redirects to another page without the visitor even noticing.

NancyDru’s picture

Drupal has a replacement for teh header function because it's possible to confuse Drupal with that.

abandoned’s picture

I have had the same problem with this additional "Welcome" data.
It occured only with user defined roles.

In page: Administer > Site information [admin/settings/site-information]
I have changed: "Default front page:"
from: "node"
to: "frontpage"

This View can be found in: Administer > Views [admin/build/views]
(...if you are using Views, but propably you do...)

Hope this helps.

veriKami
(dziewczynka w organizacji)

Zoologico’s picture

Thanks for posting this.
So simple yet so powerful.
The only requirement is that you have to have the Views module which I do and it was so easy.
Thanks again.

allenshorter’s picture

This worked GREAT for me. I already had a block set up in Views that was pushing stories to this front page, so all I had to do was add a page to the view, then add a path called "Home" to that view page. Then go to admin/settings/site-information and change it to Home.

Then just remove my block from the front page, as it was not needed anymore.

joanzhang’s picture

beautiful, it works for me. thanks.

yaskme’s picture

Hi,

I had the same problem. I found a better way to do without change code. Here is how I did

I create a story (you might want to try page that's fine) and check it to appear on the frontpage. Now the welcome page is gone but only thing I stucked on the frontpage is the story/page. Hope you understand what I said.

bye bye
yaskme

nocas’s picture

if you know you're not going to use promoted content on your frontpage (b/c you're using only views, or whatever reason), go to page.tpl.php and replace

print $content;

with

if(!$is_front) print $content;

rajatgusain’s picture

Hello friends,

I faced the same problem and solved it by the new way that's why wants to share with you....

1. I made the separate region for front page. because $content hold that welcome message.
3. You can use theme_name.info file for adding new region.
4. I assign my all the content to different blocks and assign those block to the front page region that I made previously.
5. Now check I hope this solution will help you.

regards
Rajat

joeshock’s picture

Here's another option that utilizes some of the above as well. As much as I hate hacking the core, this worked best for me on this specific project.

So in a nutshell:

http://www.example.com/node redirects to whatever your homepage is set as in your Site Information settings (/admin/settings/site-information) rather than show the Welcome to your new Drupal website! default copy.

For Drupal 6 - edit node.module found in the core (modules/node) - and look for line 1756, changing it to $num_rows = TRUE; instead of FALSE. Then after that line, add the two extra lines of code seen below.

$num_rows = TRUE;
global $base_url;
drupal_goto($baseurl);
martijn.tsas’s picture

Using Drupal 6.16
I´ve simply added the following line to the css file of my theme:

#first-time {
display:none;
}

johnmullin2003’s picture

...ye but you are only hiding the text...you have not removed the default node message!!

if you disable css (a screenreader or a crawler do this) you can still read the message

joeshock’s picture

@johnmullin2003

You're exactly right. If you simply hide the div, spiders, bots, crawlers and whatever else you want to call them will pick it up still and may potentially use it for the description in your search engine result listing. That's definitely something you don't want to see if you want your company name and information to show up in search engine results vs. some default messaging.

johnmullin2003’s picture

any Drupal module/project to hide the default message without editing the Core code??

thanks all for suggestions

dman’s picture

There are dozens of ways without modifying core
Searching the handbook brings up the page pretty quick
It mentions frontpage.module if that's what you want.

cegikera’s picture

I simply went to

Administer > Site Infomation

Changed "node" to "frontpage"

That was it

NancyDru’s picture

I still don't understand what all the fuss is about. If there is content for your front page, this issue goes away. Why are so many people reluctant to put at least a "Welcome" on their front page?

osman’s picture

Time to time I find myself in need of having the homepage without of any promoted nodes. So I totally understand the reasoning here.
Also I prefer not to use a module if the feature I need is already available in core.

Here is what I have in settings.php on my Pressflow distribution.

/**
 * String overrides:
 *
 * To override specific strings on your site with or without enabling locale
 * module, add an entry to this list. This functionality allows you to change
 * a small number of your site's default English language interface strings.
 *
 * Remove the leading hash signs to enable.
 */
$conf['locale_custom_strings_en'] = array(
#   'forum'      => 'Discussion board',
#   '@count min' => '@count minutes',
    '<h1 class="title">Welcome to your new Pressflow website!</h1><p>Please follow these steps to set up and start using your website:</p>' => '',
    '<strong>Configure your website</strong> Once logged in, visit the <a href="@admin">administration section</a>, where you can <a href="@config">customize and configure</a> all aspects of your website.' => '',
    '<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.' => '',
    '<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.' => '',
    '<strong>Start posting content</strong> Finally, you can <a href="@content">create content</a> for your website. This message will disappear once you have promoted a post to the front page.' => '',
    'For more information, please refer to the <a href="@help">help section</a>, or the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a>, or view the wide range of <a href="@support">other support options</a> available.' => '',
);

By overriding the strings in first-time, I get an empty HTML markup which I can hide easily with CSS:

<div id="first-time"><ol><li></li><li></li><li></li><li></li></ol><p></p></div>

I hope it helps.

osman

mennonot’s picture

Osman,

Thanks, this is a great solution to remove the welcome / first-time message with hacking core in Drupal 6.x. For others convenience, here is s osman's code with minor tweaking for the default Drupal installation:

/**
 * String overrides:
 *
 * To override specific strings on your site with or without enabling locale
 * module, add an entry to this list. This functionality allows you to change
 * a small number of your site's default English language interface strings.
 *
 * Remove the leading hash signs to enable.
 */
# $conf['locale_custom_strings_en'] = array(
#   'forum'      => 'Discussion board',
#   '@count min' => '@count minutes',
# );
$conf['locale_custom_strings_en'] = array(
#   'forum'      => 'Discussion board',
#   '@count min' => '@count minutes',
    '<h1 class="title">Welcome to your new Drupal website!</h1><p>Please follow these steps to set up and start using your website:</p>' => '',
    '<strong>Configure your website</strong> Once logged in, visit the <a href="@admin">administration section</a>, where you can <a href="@config">customize and configure</a> all aspects of your website.' => '',
    '<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.' => '',
    '<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.' => '',
    '<strong>Start posting content</strong> Finally, you can <a href="@content">create content</a> for your website. This message will disappear once you have promoted a post to the front page.' => '',
    'For more information, please refer to the <a href="@help">help section</a>, or the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a>, or view the wide range of <a href="@support">other support options</a> available.' => '',
);

and here's the css that gets rid of the remaining markup:

#first-time {
display:none;
}
bardya’s picture

I tried the css hide approach, but when you look up the site on google you will see

Welcome to your new Drupal website! Please follow these steps to set up and start using your website: Configure your website Once logged in,...

In order to fix it I created a new node (node-16) with a modified version of the slogan of the site, created page-front.tpl.php and added new div around main content called front-page-main-hide and the css code of

#front-page-main-hide  #node-16, #front-page-main-hide  h1.page-title{
display: none;
}
appmux’s picture

Well, I've read enough topics like this and decided to develop a solution for this very old problem, once and for all, here:

http://drupal.org/project/unwelcome

Everybody is welcome to use! Cheers.

theropodx’s picture

Works great. Thanks very much for this appmux!

gurtner’s picture

This is what I did to make it work for me:

1. Create a homepage (call it "Homepage" with url-alias "homepage", if you like)

2. In your page.tpl.php file, where you're h1 tag is located, write this:

<?php if ($is_front == false): ?>
<?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
<?php endif; ?>

3. Then, also in your page.tpl.php file, where it says

<?php print render($page['content']); ?>

write in the line right above it this:

<?php hide($page['first-time']); ?>

4. Then under Configuration > Site Information, where is says "Default front page," write in "homepage" (or whatever you named it)

This works best for me and so far I haven't had any trouble or even SEO any issues with it. It's also very helpful because I don't have to write it over and over again, every time a new version of Drupal come out. Plus, God won't kill a kitten when I hack core.

danielgurtner.com

gurtner’s picture

This is what I did to make it work for me:

1. Create a homepage (call it "Homepage" with url-alias "homepage", if you like)

2. In your page.tpl.php file, where you're h1 tag is located, write this:

<?php if ($is_front == false): ?>
<?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
<?php endif; ?>

3. Then, also in your page.tpl.php file, where it says

<?php print render($page['content']); ?>

write in the line right above it this:

<?php hide($page['first-time']); ?>

4. Then under Configuration > Site Information, where is says "Default front page," write in "homepage" (or whatever you named it)

This works best for me and so far I haven't had any trouble or even SEO any issues with it. It's also very helpful because I don't have to write it over and over again, every time a new version of Drupal come out. Plus, God won't kill a kitten when I hack core.

danielgurtner.com

VM’s picture

looks like you're using D7

you could use a custom page--front.tpl.php with your hiding of the wecome or render a new region in place of the content region and remove the content variable.

ricky1006’s picture

Inspecting the code of the variable $content in drupal 7 i noticed that the div with class "first-time" is a default message. Do not just hide $content the message remains.

You have to delete the contents of the $page['content'] ['system_main'] ['default_message'] when the div contains the prefix "first-time".

  if($page['content']['system_main']['default_message']['#prefix'] == '<div id="first-time">'){
    $page['content']['system_main']['default_message'] = array();
  } 

I hope I have been of help!

core44’s picture

You can always just use the following in a hook_preprocess_page(&$variables) function in your theme template.

 unset($variables['page']['content']['system_main']['default_message']);

I dont see any other use for ['default_message'] so I cant see a problem just universally unsetting the whole array. I personally think there should be a simple checkbox to turn this message off in admin, as in most cases its just an annoyance.

vgutekunst’s picture

hi how i have to write the command exactly? I putted ur code in my template.php but it doesnt work.

i used this:

function MYTHEMENAME_hook_preprocess_page(&$variables) 
{
unset($variables['page']['content']['system_main']['default_message']);
}

and putted into my template.php

ergow’s picture

Six years later I have the same problem to remove the famous message and I try to avoid with a content like a blog entry or and article but as I have a views in front page this solution make appears a pager i don't want. So I try another solution, us I'm using D7 I can not use unwelcome module. I prove Front page module with no good results.

I'm using rubix theme in my website http://www.prevenzion.com I can't belive I can't found any easy solution for that!

Thanks a lot in advance.

ergow’s picture

Finally I have redirect to another page in configuration/system/ web site information

and seems works well.

VM’s picture

the pager could have been turned off in the view.

manumad40’s picture

Here you have some easy options to do this (without hacking the Drupal's core code):

Removing the "Welcome to your new Drupal website" from the front page
https://drupal.org/node/61233