Stop a page having a URL. (3 posts)

  1. obenns
    Posted 3 years ago #

    Hi guys,

    I've got a one page javascript site that only has one url, domain.com/blog . As well as obviously all the blog posts having urls.

    That's all fine, but basically what I have done is on my index.php is include pages in the page such as the following:

    <?php $recent = new WP_Query("pagename=about"); while($recent->have_posts()) : $recent->the_post();?>
           <h1><?php the_title(); ?></h1>
           <?php the_content(); ?>
    <?php endwhile; ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    As this content will only be displayed on the homepage, I don't want individual pages at all, nor for search engines to pick these up. I don't have a navigation so that's fine I just mean I don't want say domain.com/about to be an available accessible url for the user, even if they type it in.


  2. obenns
    Posted 3 years ago #

    Sorry re-reading this. The main site is at the root e.g. domain.com. Where all the pages are getting pulled in etc.

    It's having a blog however at http://www.domain.com/blog

    Hope that makes a little more sense

  3. esmi
    Forum Moderator
    Posted 3 years ago #

    If you don't display links to any of the pages, the search engines won't pick them up or index them.

Topic Closed

This topic has been closed to new replies.

About this Topic