{"id":848,"date":"2014-09-10T08:26:09","date_gmt":"2014-09-10T08:26:09","guid":{"rendered":"http:\/\/www.advancedwebhelp.com\/blog\/?p=848"},"modified":"2014-09-10T08:33:52","modified_gmt":"2014-09-10T08:33:52","slug":"drupal-7-remove-no-front-page-content-message","status":"publish","type":"post","link":"https:\/\/www.advancedwebhelp.com\/blog\/2014\/drupal-7-remove-no-front-page-content-message","title":{"rendered":"Drupal 7: Remove &#8220;No front page content &#8230;&#8221; message"},"content":{"rendered":"<p>Today, I noticed that that Google had found my website and the description showed the Drupal default message &#8220;No front page content has been created yet.&#8221;   Definitely, the front page exists and contained content.  However, I had not wanted to create an article page or other item and promote it to the front page.   Therefore, Drupal was displaying that message.  I had used CSS to hide the phrase, it seemed by a simple solution, but, hiding the content did not hide it from Google &#8230; Oops.<\/p>\n<p>An option would have been to recreate the home page and in the administration area request the redefinition of the page to be used as the front page, a page that would not create that message.   However, I did not want to recreate the page.  I had already created several custom templates, including the page.tpl.php file.   However, the message is embedded inside the $page content and printed by the line to render page content:<\/p>\n<p>&#60;&#63;php print render($page[&#8216;content&#8217;]); &#63;&#62;<\/p>\n<p>The question became, how do you remove the particular content and not damage the page as a whole.   the answer is to unset the undesired content.  the following command at the top of the <b>page.tlp.php<\/b> file removes the desired message without damaging anything else:<\/p>\n<pre><code>\r\n   \r\n    <&#63;php if(drupal_is_front_page()) {\r\n              unset(&#36;page['content']['system_main']['default_message']);\r\n          } \r\n     &#63;>\r\n\r\n<\/code><\/pre>\n<p><\/p>\n<p>This same concept can be used to remove any unwanted text. <\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, I noticed that that Google had found my website and the description showed the Drupal default message &#8220;No front page content has been created yet.&#8221; Definitely, the front page exists and contained content. However, I had not wanted to create an article page or other item and promote it to the front page. Therefore, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,5],"tags":[],"class_list":["post-848","post","type-post","status-publish","format-standard","hentry","category-drupal","category-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts\/848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/comments?post=848"}],"version-history":[{"count":2,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts\/848\/revisions"}],"predecessor-version":[{"id":853,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts\/848\/revisions\/853"}],"wp:attachment":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/media?parent=848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/categories?post=848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/tags?post=848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}