For SEO reasons I'd like the urls to be preserved on the Drupal site. Does this module do that?
Thanks,
Shai
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | blogger_preserve_path.zip | 1.53 KB | haleagar |
| #13 | cmdule.tar_.gz | 474 bytes | ParisLiakos |
For SEO reasons I'd like the urls to be preserved on the Drupal site. Does this module do that?
Thanks,
Shai
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | blogger_preserve_path.zip | 1.53 KB | haleagar |
| #13 | cmdule.tar_.gz | 474 bytes | ParisLiakos |
Comments
Comment #1
ParisLiakos commentedRight now, nope.. i will try to get this functionality to 7.x-2.x though (will take a while)
till then, patches are welcomed
Comment #2
ParisLiakos commentedComment #3
ParisLiakos commentedActually this doesn't make sense for SEO since the domain name changes.
After import you could just have pathauto do this job for you creating a human-friendly pattern for the content type you imported your posts to and then updating existing content url aliases
Comment #4
attheshow commentedI might try to work on this. Basically I need it to work like this for SEO purposes:
http://example.blogspot.com/post.html
http://newblogurl.example.com/post.html
I'm going to do a meta refresh from the blogger template to have the user forwarded over to the same URL at the new domain. That means I need this module to recreate the post at the same address on the new domain.
Comment #5
attheshow commentedI coded a little custom module for my site that takes advantage of the existing HOOK_blogger_importer_node. Basically the code of the module file looks like this:
If you do this sort of thing, the import process should bring over the legacy URLs for you during the node save process. Just be sure to replace "example.blogspot.com" in the code above the the base URL of your old Blogger blog!
Comment #6
attheshow commentedIn case anyone else needs to do this: It also looks like if you have the Pathauto module turned on in D7, it monkeys with the URL aliases that you're trying to preserve. I recommend temporarily turning Pathauto off while you do the Blogger import, then turn it back on.
Comment #7
elijah lynnThanks for the code snippet attheshow and everyone else for the module!
I am having trouble getting this to work, I put it in a custom module and I don't get any errors but I don't have any redirects on import. I did replace my domain and the hook name etc. I have redirect and global_redirect enabled. Do I need to have another module to make this work?
Thanks
Update: Btw, I am doing the same thing you are doing with the redirects to a new domain. This really should be in the main module as it is best SEO practice. Maybe when I am more up to speed on this I can contribute something back that helps get this in.
Comment #8
elijah lynnOkay, I see now that it doesn't do redirects, which is what I want, but I cannot even get it to make the paths. I also am not getting the "'hello! no presave.'" dsm.
Comment #9
elijah lynnI am not sure the hook is working. I set a breakpoint in xdebug and it just flies right on by.
Here is my module (blog_path), note that I tried with and without the reference on $node, the documentation in README.txt says to use a reference:
Edit: Also, in batch.nodes.inc on line 247 it says:
The comment has the order different for the parameters and also _alter appended. Can someone unconfuse me?
Thanks!
Comment #10
ParisLiakos commentedThis is the new usage of this
Comment #11
elijah lynnCoincidentally, that is what I was trying after reading that. But still nothing is happening on import, nor am I able to get a breakpoint to fire. However, there is one difference. I am prefacing with function:
function blog_path_blogger_importer_node($node, $post, $op).Is that intentional?
However, if I mess up the code in the module it will throw a PHP error on a white page.
Comment #12
ParisLiakos commentedah sorry missed function.
it should be in you case:
Comment #13
ParisLiakos commentedPosted the module here. if you dont have devel module installed, remove the dpm lines
Comment #14
ParisLiakos commentedCan someone please expose two textfields for this module so this one can be included in next blogger_importer release?
Right now blog name is hardcoded inside this function, if we can get this sorted this is ready to go, just tested myself works great
Comment #15
elijah lynnThank you very much rootatwc!
It turns out that I enabled your module and it works!!!
It also turns out that I had not even enabled my module. I had done it so many times after doing a database restore that the last time I did it with the right HOOK implementation I forgot to enable the module.
Sorry for wasting an hour of your life.
At the very least I will submit a patch to have the README.txt reflect the new HOOK.
Also for those who want to test if this works, if you install Drush and Devel you can run
drush hook blogger_importer_node_alterand it should return the name of the module (cmdule).Comment #16
elijah lynnExposing the text fields is a bit over my head right now but if someone wants to setup a time to mentor me on how to do that on IRC I would be happy to give it a go.
Comment #17
elijah lynnWe also need to get the template file that needs to be enabled on blogger to do the new canonical name that redirects to the new domain, that is an associated but separate ticket. There is some example text here on doing a Blogger to Wordpress migration while retaining Google Rank (with canonical) - http://www.labnol.org/internet/switch-from-blogger-to-wordpress/9707/
edit: I just made a new issue for this here --> http://drupal.org/node/1796970
Comment #18
pazzaglia commentedI'm also interested in the feature Blogger to durpal maintaining the URL. In a couple of months I would like to move my sizable blog to a this platform.
Perhaps, what the original requester did not mention - or at least is MY case - is that I have a Blogger Blog with custom domain. So all of my posts are linked from google (and eachother) using:
http://www.mysite.com/2012/11/postname.html
I would like to import the XML file and re-create the same file structure OR have some way to automatically generate redirects to the new php pages - my site has over 200 pages (thousands of links from other sites to individual pages) so it's just impossible to do this by hand in the three days it will take to transfer my domain from google to a web host running Durpal.
The Canonical tag would be the same kind of individual effort for each post, and would only work if I kept the blog running on the domain name on blogger and not to a web host running Durpal.
Thanks for all of you work on this so far, and I hope you can help me get off Blogger in a painless way!!
Comment #19
stratos commentedCould you explain me clearly, what to do with that code? Should I create a new own module with it? How?
Thanks for answer for my stupid question.
Comment #20
haleagar commentedOK as requested I exposed the old URL to strip out on a configuration page so you could use this module, preserving paths with no code edits.
Comment #21
haleagar commentedComment #22
haleagar commentedadded further option to have two source urls, and handle with and without the www.
Comment #23
cgmonroe commentedFYI - The code in #21 has a few bugs in it.
- Schema Removed if no alt domain name is specified
If you do not specify and alternate URL in the set up page, all URLs in the body text will have the http:// or https:// prefix stripped. This is because the default value of '' creates a string replace for "http://" only.
Quick fix is to make sure to add an alternate URL whether you need it or not.
Longs term fix would be to check for a value before doing the replace calls in the code.
- Path not preserved if pathauto module is enabled.
Fix is to have the following after the alias is set.
- Undefined index: url in blogger_preserve_path_blogger_importer_node_alter() (line 23 of blogger_preserve_path.module)