How to hide URL from bibliography by using a harvard style?

I want my bibliography without URL fields. After modifying natbib here:

\newcommand\harvardurl[1]{\textbf{URL:} \textit{#1}}


to

\newcommand\harvardurl[1]{}


I noticed a blank line where the URL used to be. Modifying the .bib file is not an option.

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  egreg Jan 14 '12 at 15:23
It would be useful if you stated which bibliography style you employ. Is it one of the seven files -- agsm, apsr, dcu, jmr, jphysicsB, kluwer, and nederlands -- of the "harvard"-family of bibliography style files? Separately, do you load the harvard package in addition to natbib? –  Mico Jan 14 '12 at 17:08
I am a using gsm style file found here: civil.iitb.ac.in/tvm/2905-natBibUsage/natbibusage/… No harvard package included. –  cevel Jan 15 '12 at 13:29

There are six styles provided by harvard which are compatible with natbib.

The command \harvardurl only format the style of the url. The output of the url is defined in the used bst file.

As an example of one of the six styles I use the file agsm.bst to demonstrate the behavior.

The file agsm.bst has the following code:

FUNCTION {write.url}
{ URL empty${ skip$ }
{ "\newline\harvardurl{" URL * "}" * write$newline$ }
if\$
}


If the entry of the url is empty you will get no output. Otherwise you get the output:

\newline URL formated with \harvardurl \newline


To avoid the output of the url you must modify the bst file.

Please note: Never change the original bst file. Make a copy of the needed bst in your working directory and modify this new file.

-
Absolutely right. Just dropped the line and worked like a charm. Cheers –  cevel Jan 14 '12 at 15:58