Monte Carlo simulations in the constant voltage ensemble were performed for electrolytes in porous electrodes. It was found that the electrical and mechanical properties in porous electrodes dramatically change depending on the pore size and the dielectric constant of the medium. For a low dielectric constant of the medium, the capacitance of porous electrodes tends to increase as the pore size decreases and the pressure in the porous electrodes is positive or negative depending on the pore size. For a high dielectric constant of the medium, on the contrary, the capacitance tends to decrease as the pore size decreases and the pressure is positive for all the conditions studied here. Such pore size dependencies are explained in terms of the balance between the electrostatic interaction and the volume exclusion interaction in the porous electrode.