5. Given that $p$ and $q$ are rational numbers, and $x=\frac{\sqrt{5}-1}{2}$ satisfies $x^{3}+p x+q=0$. Then the value of $p+q$ is ( ).
(A) -1
(B) 1
(C) -3
(D) 3
5. A.

Substitute $x=\frac{\sqrt{5}-1}{2}$ into $x^{3}+p x+q=0$, and simplify to get
$$
4 \sqrt{5}(2+p)+4(2 q-p-4)=0 \text {. }
$$

Since $p, q$ are rational numbers, we have
$$
\left\{\begin{array}{l}
2+p=0, \\
2 q-p-4=0 .
\end{array}\right.
$$

Solving these, we get $p=-2, q=1$.
Therefore, $p+q=-1$.