When Bank of America voluntarily dismissed its foreclosure action against Jaime and Viviana Lopez, the Lopezes sought attorney’s fees pursuant to Florida Rule of Civil Procedure 1.420(d), which addresses costs awardable to a defendant when a plaintiff voluntarily dismisses a case. But they had not pleaded entitlement to attorney’s fees in their answer to the bank’s complaint. The circuit court denied their motion for fees, and we affirm.
The Lopezes contend that they should be awarded attorney’s fees under rule 1.420(d) notwithstanding their failure to plead entitlement to fees because their contracts with the bank included attorney’s fees as part of recoverable costs. They rely on Wilson v. Rose Printing Co., 624 So.2d 257 (Fla.1993), which at first glance might appear to support their argument. In that case, Wilson voluntarily dismissed his suit against his employer, Rose Printing, which then sought attorney’s fees. The employment contract between the parties stated that “[i]n connection with any litigation arising out of this agreement the prevailing party shall be entitled to recover all costs incurred, including reasonable attorney’s fees for such litigation and any subsequent appeals.” Id. at 258 (emphasis supplied).'
The circuit court refused to award Rose Printing prevailing party attorney’s fees because it found that Wilson dismissed his suit for strategic reasons and that a prevailing party could not be determined. Rose Printing Co. v. Wilson, 602 So.2d 600, 602 (Fla. 1st DCA 1992), approved, 624 So.2d 257. As a general rule, when a plaintiff voluntarily dismisses a complaint, the defendant is deemed to be the prevailing party for purposes of attorney’s fees. Thornber v. City of Fort Walton Beach, 568 So.2d 914, 919 (Fla.1990); Ajax Paving Indus., Inc. v. Hardaway Co., 824 So.2d 1026, 1029 (Fla. 2d DCA 2002). Also, contractual prevailing party fees generally are sought by filing a motion under Florida Rule of Civil Procedure 1.525. In Wilson, however, the supreme court observed that the contractual prevailing party requirement was irrelevant because Rose Printing was seeking fees as part of its recoverable costs under rule 1.420(d), not under the contract’s fee provision. Wilson, 624 So.2d at 258. This was made possible because the parties’ contract included attorney’s fees in its definition of costs. Id.
The Lopezes’ contracts with the bank also define attorney’s fees as costs. There is, however, a crucial distinction between Wilson and this case. Unlike the Lopezes, Rose Printing had pleaded its entitlement to attorney’s fees; it had requested “taxation of costs and attorney’s fees against Wilson” in its answer to the complaint. See Rose Printing, 602 So.2d at 601. Therefore, the case before us poses a question that Wilson did not reach— whether parties may recover attorney’s fees as part of their costs under rule 1.420(d) if they have not sought attorney’s fees in their pleadings. The answer is found in Stockman v. Downs, 573 So.2d *924835 (Fla.1991), a case decided several years before Wilson.
In Stockman, the following question was certified to the Florida Supreme Court:
MAY A PREVAILING PARTY RECOVER ATTORNEY’S FEES AUTHORIZED IN A STATUTE OR CONTRACT BY A MOTION FILED WITHIN A REASONABLE TIME AFTER ENTRY OF A FINAL JUDGMENT, WHICH MOTION RAISES THE ISSUE OF THAT PARTY’S ENTITLEMENT TO ATTORNEYS FEES FOR THE FIRST TIME?
Id. at 836. The court held that all claims for attorney’s fees, whether based on statute or contract, must be pleaded. The court noted that modern pleadings must notify an opposing party of the claims being raised in order to avoid unfair surprise, and a potential obligation to pay fees could be determinative in an opposing party’s decision “to pursue a claim, dismiss it, or settle.” Id. at 837.
Stockman described only one exception to this rule, when a party has notice that its opponent is claiming fees and by its conduct “recognizes or acquiesces to that claim.” Id. at 838. Later decisions have recognized another exception in cases involving involuntary dismissals: If the complaint is “dismissed before the defendant has filed a responsive pleading, a request for fees is deemed properly pleaded if it was either asserted in a motion to dismiss or in a separate motion filed within thirty days of the dismissal of the action.” See, e.g., Ajax, 824 So.2d at 1029. Neither of those exceptions apply here.
Wilson did not create an exception to Stockman; it had no reason to do so because Rose Printing had followed Stock-man’s dictates by pleading its right to fees and therefore placing Wilson on notice that it would be seeking them. Thus, Wilson simply does not support the proposition that entitlement to fees need not be pleaded in the context of a voluntary dismissal because that issue was not present in that case.
In summary, we hold that when a plaintiff voluntarily dismisses a complaint, a defendant may be awarded attorney’s fees as costs under rule 1.420(d) if the parties’ contract or a statute defines fees as an element of costs and the defendant either had given notice that he was claiming fees in his responsive pleading or falls within the exceptions outlined in Stockman and Ajax.
In reaching this result, we are cognizant that we have held that a party is not required to plead entitlement to costs. See First Protective Ins. Co. v. Featherston, 978 So.2d 881 (Fla. 2d DCA 2008). That opinion, however, specifically distinguished costs from attorney’s fees:
In considering the appropriate pleading requirements, there is a material difference between attorney’s fees and costs. Unlike costs, ordinarily attorney’s fees are not recoverable and thus are not at issue. There is no generally applicable statute which entitles a prevailing party to a recovery of attorney’s fees. Accordingly, where there is a statutory or contractual basis for an award of attorney’s fees, proper pleading requires that a party seeking attorney’s fees put the other party or parties on notice that attorney’s fees are at issue in the litigation.
Id. at 884. The Featherston court addressed the costs allowed pursuant to statute, generally referred to as court costs, that are inherent in every lawsuit. See id. (pointing to various statutes authorizing costs and noting that “[although the standard for the award of costs may — based on specific statutory provisions — vary from the general standard set forth in section *92557.041, it is universally true that costs are at issue when a lawsuit is brought”); cf. In re Amendments to Uniform Guidelines for Taxation of Costs, 915 So.2d 612 (Fla.2005). Wilson makes it clear that parties, by contract, may expand the ordinary definition of costs to include attorney’s fees. But a contract between parties cannot abrogate the requirement that entitlement to attorney’s fees must be pleaded.
Affirmed.
MORRIS and BLACK, JJ., Concur.