Welcome to WebmasterWorld Guest from 54.198.52.8

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Move from Wordpress to static php pages

     
2:15 pm on Dec 4, 2015 (gmt 0)

Preferred Member

10+ Year Member Top Contributors Of The Month

joined:Aug 16, 2004
posts:370
votes: 3


Afternoon!

I run Wordpress for the "blog" section of my site. However, I don't need / want most of the features Wordpress offers (such as commenting, etc).

I was therefore thinking of reverting all content to static php pages and then use phpincludes for the header, footer and navifgation, etc.

However, what I can't get my head round is how I can replace each page, without having to create a new URL (if that makes sense).

IE: example.com/blog/article1/ - how can I replace that with a static page but keep the same URL?

OR....would it be easier for me to redirect each page individually using new URLs (but then I'm concerned it could affect SERP placements).

Hope all this makes sense?
4:51 pm on Dec 4, 2015 (gmt 0)

Senior Member

WebmasterWorld Senior Member planet13 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:June 16, 2010
posts: 3823
votes: 29


I think if you want to keep the URLs then you MIGTH be able to do that in your .htaccess file.

I have to admit that making changes in .htaccess is WAY above my head, but whenever I have had questions, I have been able to find answers in the apache forum:

[webmasterworld.com...]

Hope this helps.
6:54 pm on Dec 4, 2015 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:3451
votes: 181


Thing is that all URLs inside the /blog/ WP installation are controlled by WP and it generally will ignore htaccess rules that conflict with its functions and settings.

A 301 rewrite from the original to the new URLs should not cause SERP issues if the changes are supported with the sitemap. You don't want the old URLs in the sitemap after the content is found on a different URL.

Just curious though, did you know you can turn off comments and control most of the unused/unwanted features in WP and not need to rebuild/redirect to new pages? I am not a big fan of plugins but for things you can't fix in your WP Settings panel, there are plugins to turn functions on and off - if you don't want to fuss with the core files or css.
6:59 pm on Dec 4, 2015 (gmt 0)

Preferred Member

10+ Year Member Top Contributors Of The Month

joined:Aug 16, 2004
posts:370
votes: 3


not2easy - yeah I have already removed a lot of the "bloat" from the header but I think I'd be able to manage things much easier (and also have a faster site), by simply having static pages.

If I rewrote the URL for about 100 pages all in one go, is this likely to cause an issue, do you think?

Thanks everyone for your input!
7:24 pm on Dec 4, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:7782
votes: 531


For something of this size I'd do them all at the same time, make a clean break as quickly as possible. If your redirects are correct you should see no problems at all.
7:27 pm on Dec 4, 2015 (gmt 0)

Preferred Member

10+ Year Member Top Contributors Of The Month

joined:Aug 16, 2004
posts: 370
votes: 3


Thanks, Tangor - think I'm going to maybe have to plan this on paper carefully before implementing and then do all the pages in one go.

My plan is this - upload all individual pages first (essentially duplicating everything but at their new URL,

Once they've all uploaded, then implement the 301 redirect for each page.

I'll try and get all this done in a day.
7:42 pm on Dec 4, 2015 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 28, 2002
posts:994
votes: 2


You don't necessarily have to change your URLs if you don't want to. It would be quite easy to recreate the exact same URL structure you currently have with WP.

Just create a rewrite rule in your htaccess that rewrites all requests for /pagename/ to /pagename.php internally so you don't have the php extension. Everything else would simply require making appropriate subdirectories such as /blog/ etc. as needed and putting the pages in there.

Of course, you may not want to keep the current structure, just making sure you realize there is no reason you can't.
10:12 pm on Dec 14, 2015 (gmt 0)

Moderator

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8510
votes: 228


Have a look at the last couple of posts in this thread. It might be too late for you, but the idea is a site that is produced by a script, but published as static.

[webmasterworld.com...]

As for the original question, by default if Wordpress finds that a request is for a file, it doesn't invoke Wordpress. So you just need an extra rewrite rule to rewrite a request for my-page to my-page.php

The only one that I've found to be tricky is the home page. That is going to have to be the last one to go from your Wordpress install
4:40 pm on Dec 15, 2015 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 17, 2002
posts:1187
votes: 6


I did this with the two WP sites I was running. Both are around 100 pages and I took looked for a flawless solution to convert them to static pages.

I chose an add-in to do it. It read the WP db, templates and created a zip file of the static pages with all links to style sheets etc. in place. I forget, which one I choose (there were two main ones to choose from) and I can't check what it was because I have totally toasted WP now. But it did work flawlessly for the two 100+ page sites I had.

You can test it if you wish. Install the add-in, download the zip and run it offline or in a subfolder. Once you are happy just delete the old file structure, drop the tables and upload the static files. Of course you will need to recode any comments code that required the db but things like jquery functions still worked.
4:52 pm on Dec 15, 2015 (gmt 0)

Preferred Member

10+ Year Member Top Contributors Of The Month

joined:Aug 16, 2004
posts: 370
votes: 3


Cheers everyone!