WordPress.org

Ready to get started?Download WordPress

Forums

Block off /blog/ on main site (8 posts)

  1. faktanett
    Member
    Posted 1 year ago #

    Hi

    I am running a network of sites using multisite, and pulling content from the sub blogs to main blog with WpeMatico, so new posts on all sub blogs are presented on front page/main blog.

    Now, although I have linked post titles to source link, so they point to the respective sub-blogs on front page, a /blog/ part is still created on my main site showing full content.

    How can I close this down so it is not accessible to people, and more importantly search engines, as I do not want the content to be duped in full on the main site?

  2. dohman
    Member
    Posted 1 year ago #

    to notify the search engines & keep them from indexing them you can add a noindex to these posts using an seo plugin like SEO by yoast.

    it looks like theWpeMatico plugin has a "private" status option. will it still post the posts/titles to your front page with that option selected?

    also check for an option to just post an excerpt rather than the full text.

    you can also check another plugin called "wordpress mu sitewide tags pages" with does what it sounds like you are trying to do.

  3. Manijero.com
    Member
    Posted 1 year ago #

    In the options-permalink.php is where is hard coded the /blog/

    add_filter('admin_head', 'add_js');
    
    include('./admin-header.php');
    
    $home_path = get_home_path();
    $iis7_permalinks = iis7_supports_permalinks();
    
    $prefix = $blog_prefix = '';
    if ( ! got_mod_rewrite() && ! $iis7_permalinks )
    	$prefix = '/index.php';
    if ( is_multisite() && !is_subdomain_install() && is_main_site() )
    	$blog_prefix = '/blog';

    and forward in the same file

    if ( is_multisite() && !is_subdomain_install() && is_main_site() ) {
    	$permalink_structure = preg_replace( '|^/?your_prefix|', '', $permalink_structure );
    	$category_base = preg_replace( '|^/?your_prefix|', '', $category_base );
    	$tag_base = preg_replace( '|^/?your_prefix|', '', $tag_base );
    }

    I'd tried and is working.

  4. Manijero.com
    Member
    Posted 1 year ago #

    Just change blog for your prefix.

  5. Manijero.com, DO NOT EDIT CORE FILES.

    Unless you're patching core, there's no reason to ever suggest anyone hack core. That's bad practice, and not supported by anyone.

    The problem isn't Core. it's his plugin and how it pushes out posts. It appears that it's not pushing aliases, but actually multiposting the same content to multiple sites, which is problematic. Sitewide tags does this 'better' and always links back to the 'real' site.

  6. Manijero.com
    Member
    Posted 1 year ago #

    Thanks for the warning. I know it's not the best practice but do not understand why the prefix is fixed in the main blog.

    Sure there's a reason but I can not understand it. I had to do it because the customer who is always right, can not use a domain-based multisite and appears not handle blog / in the root of permalinks.

    If that data was in the database as everything else would not need hack the core.

  7. faktanett
    Member
    Posted 1 year ago #

    I could not get Sitewide tags to functing how I want this to work

    Let's draw a picture

    animalfarm.com (main site)
    ---dogfarm.com (sub 1)
    ---catfarm.com (sub 2)
    ---pigfarm.com (sub 3)

    WpeMatico runs crons and autoposts from sub 1, 2 and 3s respective RSS feeds to categories on main site named after the sub sites (so, content from dogfarm.com is posted on animalfarm.com in a category called....wait for it....dogfarm.com)

    WpeMatico also links title of these posts back to the feed source (post on dogfarm.com).

    Animalfarm.com in turn is set up to show featured image and excerpt from these posts on it's front page, with title linked back to original site.

    However, the way WP works, these posts are also accessible by accessing animalfarm.com/blog/dogfarm.com/

    THAT is what I want to stop.

    Basically, I would like animalfarm.com to only have front page and pages accessible to users, no blog categories.

  8. Since your plugin is cross-posting, you'll have to use .htaccess redirects.

    Send animalfarm.com/blog/dogfarm.com/ to dogfarm.com and so on.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags