Things You'll Need
Lamp Socket Only Or Complete Socket Assembly
While the instructions here refer specifically to incandescent table lamps, the principles are the same for all table, floor and desk lamps. You may see the word press stamped at the location where you press to remove a socket shell. Use pliers if thumb pressure is not enough. Look closely at the cord. One wire is ribbed to identify it as neutral. On a cord with a polarized molded plug, this wire connects to the wider plug prong. If you are installing your own plug (see How to Fix an Electrical Plug), follow this convention. Feeding new cords into some floor lamps and desk lamps is easier if you first tie string to one wire of the old cord instead of twisting the wires together. Lubricate a cord you're pulling through tight curves with a lubricant sold at electrical-supply outlets for "fished" wires and cables. If you are replacing a socket, use the switch type you want--chain, push, rotating, on-off or three-way.
The Underwriters knot keeps a cord from being jerked out of its terminal, protecting you against a possible electrical short or shock. Polarized plugs have a wide neutral prong and can only plug one way into a receptacle. In a properly wired lamp, the polarized plug ensures that the hot wire energizes the metal tab at the bottom of the socket, which is less exposed to fingers than is the threaded shell.
The most common problem with lamps is a faulty socket or switch within that socket. Loose or faulty wiring comes next. Use this eHow as a guide to help you figure out what might be wrong with your lamp and then fix it.
Unplug the lamp to inspect the plug and cord for any visible damage. To replace a damaged plug, see How to Fix an Electrical Plug. To replace a cord, see "Rewire a lamp".
If you don't see any damage, remove the shade and bulb, slide up the sleeves that fit over the harp holder and squeeze the arms together to remove the harp. Depress the socket's shell just above its base with your thumb to disengage the clips that hold the two pieces together while you rock out the shell.
Clip a continuity tester to one of the plug prongs and probe each of the socket's screw terminals with the pointed lead. Repeat for the other prong. If the test light does not go on once for each test, replace the cord.
Test the socket by clipping a continuity tester's lead to the threaded shell and probing the metal tab at the bottom of the socket with the other lead, then operating the switch. The test light should go on when the switch is in one position but not the other, except in the case of a three-way switch, which has three On positions and one Off position. Replace a faulty socket.
With the socket taken apart (see illustration), loosen the terminal screws to disconnect the wires and untie the Underwriters knot. Also remove the felt cover (if any) from the bottom of the lamp.
If the cord travels through anything longer than a short threaded nipple extending from one end of the lamp to the other, cut the cord at the bottom of the lamp, leaving 6 inches (15 cm) exposed; you'll need the old cord to pull the new one through the lamp.
Split apart the wires on the old and new cords so you can strip about 1 inch (2.5 cm) of insulation off each wire.
Twist each wire from the new cord onto the ends of the existing wires. Tape the splice and use the old cord to pull the new cord into the lamp.
If the cord travels a very short distance, simply pull the old cord out from the bottom of the lamp and feed in the new one. Then split apart the wires to strip off the insulation.
Tie a knot in the cord just inside the hole in the lamp base, and feed the cord out through any hole in the base to install the plug (see How to Fix an Electrical Plug). If you are using a cord with a molded plug, you must tie this knot after threading it through any holes in the lamp base but before feeding it through the lamp.
Tie an Underwriters knot (see illustration) in the end of the new cord, leaving just enough wire after the knot to wrap around the socket terminals. If you leave too much, there won't be room for the excess wire inside the socket base.
Twist the loose wire strands and cut off the excess so 1/2 inch (12 mm) of wire is exposed.
Wrap the cord's neutral wire (white) clockwise around the silver terminal screw and tighten the screw. Secure the hot wire (black) under the brass terminal screw.
To replace the lamp's socket assembly, loosen any setscrew in the socket base and twist off the socket base and harp holder from the nipple.
Remove the new socket's shell from its base and screw the harp holder and new base onto the threaded nipple at the top of the lamp.
To replace just the lamp socket, leave the existing socket base and harp on the lamp and install a new socket.
Wire the socket using the existing cord or a new one as described in "Rewire a lamp," above.