For my solar tracker Arduino project I installed 2 limit switches and wired them with a 10k resistor as per Arduino's button tutorial (https://www.arduino.cc/en/Tutorial/Button).
Problem is that the noise from the solar tracker motor is generating false triggers.
I've read that the solution is to add a capacitor to this circuit. Can someone help me update the above circuit with the capacitor? Ideally, with minimal rewiring. What size capacitor should I use?
One is that you have given no indication of how your project is either wired or constructed from what parts.
The "button tutorial" is misleading in that is suggests switches are wired between Vcc and an Arduino pin. It is almost always preferable - and this would be a good example - for them to be wired between an Arduino pin and ground. You can often use pinMode(thispin, INPUT_PULLUP) but in this case you probably should use a lower value pull-up resistor. The wires to the limit switch must run as a pair from the switch to the Arduino board.
Forget the capacitors and resistors (except the one across the motor ). You need to "debounce" the switch inputs by polling in software. Research that term. Do not attempt to use interrupts.
If using software to implement limit switches, consider whether it matters when the software fails and the limits are not detected. If it is possible to cause damage or become unsafe, then the limit switches must act directly on the motor (in addition to the software).