• Resolved Robolasse

    (@robolasse)


    I have taken over the administration of a WordPress-website. Now i have discovered that there is another WP-installation with older content (WordPress 3.6) on a subdirectory on the same webhotel. My main site runs perfectly on WP 4.1 in the root folder.

    I want to remove the subdirectory installation (it interferes with the search results of the main site), but what is the best way to do that?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi :),

    Firstly get the Database name from wp-config.php of the subdirectory wordpress. And delete the database from the control panel.
    You can then simply remove the sub-directory installation folder which includes all the files and folders of the old wordpress installation.

    It is advised to have backup of all the files and folders, in case you need those for any data.

    Thread Starter Robolasse

    (@robolasse)

    I looked it up, but the two sites are using the same database name.

    the two sites are using the same database name.

    What about table_prefix? If the older site does not have its own table_prefix, then leave the database alone and just delete the subdirectory. If the two sites have different table_prefixes — check each site’s wp-config.php file to be certain — then simply drop all the tables bearing the unneeded prefix and then delete the subdirectory.

    note: Make a complete backup of that entire database before doing anything to it!

    Thread Starter Robolasse

    (@robolasse)

    They indeed do have a different prefix.

    Could i, as an alternative, make some kind of redirect in my subdirectory that sends all users to the main site?

    Could i, as an alternative, make some kind of redirect in my subdirectory that sends all users to the main site?

    That certainly can be done via .htaccess, and especially if you might have a lot of traffic going to that site and/or you want certain links people have saved there to redirect to specific pages at the primary site.

    Assuming you have something like this to the second site: site1.com/site2/

    Removing the entirety of /site2/ from your overall installations would result in that link landing at site1.com and displaying a 404 “Page Not Found” error. But again, you can certainly add some redirecting if you want specific pages from the old site to begin landing at their replacements at the new site.

    https://www.internetmarketingninjas.com/blog/search-engine-optimization/301-redirects/

    https://www.rapidtables.com/web/tools/redirect-generator.htm

    note: Added redirects would go into .htaccess for site1 since all traffic to site2 must pass through there, and then site2 could be altogether removed.

    Thread Starter Robolasse

    (@robolasse)

    That’s the way to do it. Thanks, everybody! ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Removing a WP installation from a subdirectory’ is closed to new replies.