  We use electromigration (EM) to tune the oxygen content of
YBa$_2$Cu$_3$O$_{7-\delta}$ (YBCO) nanowi\-res. During EM, the dopant oxygen
atoms in the nanowire are moved under the combined effect of electrostatic
force and Joule heating. The EM current can be tuned to either deplete or
replenish nanowires with oxygen, allowing fine tuning of its hole doping level.
Electrical transport measurements and Kelvin probe microscopy corroborate good
homogeneity of the doping level along the electromigrated nanowires. Thus, EM
provides an effective method to study transport properties of YBCO in a wide
doping range at the nanoscale in one and the same device.
